EspruinoHub IDE not offering BLE devices

Posted on
  • Hi folks

    I've replaced my office Pi 2 with a Pi 3B+, partly so that I can use it and EspruinoHub to deal with my Puck and Pixl devices. I had it working with a Pi Zero W some time back, but that board has been used in a project since then. My problem is this - the backend can see BLE devices, and continues to see the devices (I've got it running in a terminal at the moment) but the WebIDE installed alongside won't acknowledge them and I can't connect to anything. So far I've...

    1. rattled through all the repos, running npm install at every level, hoping that something will spark it up
    2. run ./start.sh as both standard and root user
    3. installed the system service
    4. deleted everything and tried again

    Still no luck. Any advice?


    2 Attachments

    • devices listed.PNG
    • no dice.PNG
  • And you're sure you're accessing the ide at pi:1888/ide and not just espruino.com/ide?

    Do you see any error messages in the Chrome Developer console when Chrome is running the IDE and trying to connect?

  • Yep, connecting straight to the Pi hosted version on port 1888. The console logs show everything working as you'd expect - lots of Initialising lines, and no errors. Connects websockets to the Pi without issue.

    I thought for a moment I'd identified something - there was a complaint about parsing JSON from the config - but there was junk in the local storage. Clearing that out got rid of that error but still no luck getting connected. I also connected to the Pi through a Chrome incognito window to make sure that there was nothing else knocking around that could've had an impact (I once had issues with the LastPass extension on another web-based IDE - that caught me out) but there was no difference.

    Checked mosquitto is running correctly - it is, and NodeRED can publish and subscribe quite happily to it. Everything looks like it should be working, but no dice :(

  • I took a look at dmesg and there were low voltage warnings every time I refreshed the IDE. Replaced the USB cable with a much better quality one; the warnings have gone but there's no difference made to the problem at hand.

  • i have espruino.com/ide working on my rpi 3 b+ in chromium, but have not been able to get a local ide build working either.

  • Aha, found it.

    • Go to EspruinoHub/EspruinoWebIDE
    • git pull
    • cd EspruinoTools
    • git pull

    Do a full page refresh on the IDE (no need to reboot EspruinoHub) and it should work.

    EspruinoHub filters by name, and I hadn't added Pixl.js to the list of devices to filter for :s

    If you'd put a Puck within range I bet it'd have worked.

  • Brilliant! That's got it. I have a Puck in range but the battery is dead - better drop into Poundland and grab a stack of their cheapy ones!

    BTW, slight topic change - is there a way to have a classic Espruino board plugged into the Pi and to code from my laptop? Just thinking about the whole Chrome Apps closure debacle; being able to plug into the little box on the shelf would be next best to a direct connection.

  • is there a way to have a classic Espruino board plugged into the Pi and to code from my laptop?

    There is :) npm install -g espruino-web-ide then espruino-server. However you might want to delete the noble package that'll get installed for espruino-web-ide so it doesn't try and access Bluetooth LE again and mess with EspruinoHub.

    Ideally USB support would get added to EspruinoHub at some point and then you could do it all from one place :)

  • (Going further off topic but I don't want to start something new)

    I've had a look at the various pieces of code in EspruinoHub and the way it's dealing with the BLE boards. Do you think there would be any mileage in implementing an MQTT conduit between the IDE and a classic board over UART?

  • Yes, definitely. At the moment is just does this: https://github.com/espruino/EspruinoHub#node-red--mqtt

    I guess a hack would be to just make it appear as a BLE device, but with DEVICE set to ttyACM0 or similar? The mqtt subscriber could spot the tty bit and hand it over to USB. Of course you'd have to fake advertise it as well, but it'd definitely work.

    Or perhaps it's worth improving the whole MQTT connection thing to make it more general purpose

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

EspruinoHub IDE not offering BLE devices

Posted by Avatar for IrregularShed @IrregularShed

Actions