Avatar for Gordon

Gordon

Member since Sep 2013 • Last active Apr 2024

Most recent activity

  • in Bangle.js
    Avatar for Gordon

    I think this might help - short, but I think it contains the jist of it: https://www.espruino.com/Fonts#custom-fo­nts

    You'll need a string containing a column-first, most significant bit first, 1 bit per pixel bitmap containing the font bitmap. Optionally you can also have another string containing the widths of each character.

  • in General
    Avatar for Gordon

    and you can just load the file as a string with require("Storage").read("filename") - the string will be kept in flash and will be loaded on demand. If it's too big to send in one go you can use E.pipe to pipe it to the HTTP response

  • in ESP32
    Avatar for Gordon

    Well, that was a nightmare. Pretty much everything was broken.

    But I have now fixed setServices, onWrite, and notifications/indications, so I think it should be ok if you try a 'cutting edge' build now

  • in ESP32
    Avatar for Gordon

    Thanks for looking into this!

    You can force the console to stay on Serial1 even when connected with BLE with Serial1.setConsole(1) which really helps with debugging.

    Also ESP32.setBLE_Debug(7) can help to display extra info too

    I looked and there is some code for handling writes there, but on trying the code above and writing I get:

    Uncaught Error: Too much recursion - the stack is about to overflow
    Execution Interrupted
    

    Is this what you see too? I'll have a look and see if I can figure out what's broken

  • in JavaScript
    Avatar for Gordon

    Is this possible via command line too?

    yes!

    --storage fn:data.bin    : Load 'data.bin' from disk and write it to Storage as 'fn'
    

    I think that works - can't remember for sure now - it's possible it attempts to write using Flash though

  • in Bangle.js
    Avatar for Gordon

    Good question!

    I have a font converter at https://github.com/espruino/EspruinoWebT­ools/blob/master/fontconverter.js which I'm using for most stuff now (like creating the font pack apps, and hopefully at some point https://www.espruino.com/Font+Converter), but it doesn't handle BDF yet.

    I've got a very hacky tool that I don't think I ever released, which I've attached below. It loads BDF and spits out a C file that can be compiled into Espruino.

    If you were up for a challenge it'd be awesome if you could add the BDF loading code from that tool into the main https://github.com/espruino/EspruinoWebT­ools/blob/master/fontconverter.js - that way you could export to JS (or a PBF file) to try things out more easily.

  • in JavaScript
    Avatar for Gordon

    That code should work

    do I need to set the watchdog's timeout higher than my code timeout?

    Yes, at least twice - I'd generally go for ~5 times the interval, just in case.

    One thing to note is that once you added the watchdog you can't change it or its interval until the device physically reboots (reset() won't cut it). It's done in hardware as a failsafe so once it's been added, it can't be undone (until a reboot/power cycle)

  • in JavaScript
    Avatar for Gordon

    I think you've misunderstood - there is an actual button for uploads!

    • Go to https://www.espruino.com/ide/
    • Connect to your device
    • Click the Storage icon (4 discs, basically in the middle of the screen)
    • Click Upload Files
    • Upload your file using the file chooser

    Uploading your way will work but as you noted it's messy!

    In your case, you can ignore the "exports" is not defined error. It's because after upload the IDE is trying to run your module as if it's a normal app - but it's a module.

  • in Projects
    Avatar for Gordon

    it would be worth having a way of using it as a connected dashboard

    Yes, I know. I wanted to make an 'Espruino' integration for Home Assistant so that you could connect and send data to Espruino devices via Bluetooth, but I haven't got around to it yet.

    But I think if I make a new board with this, I'd stick WiFi on it anyway. It'll be a bit more expensive because of the display anyway, and even if it's not used by some people being able to connect to a WiFi network would be super helpful

  • in Bangle.js
    Avatar for Gordon

    It looks like it's just displaying whatever temperature value it gets - ideally it'd be using locale: https://www.espruino.com/Bangle.js+Local­e

Actions