-
-
-
Hi
I am attempting to make a display that shows the status of a BLE device, using a Pixel.JS.
The BLE device is a relay working much like an eggtimer.
In the advertisement package the timer value is included.
So the display just needs to listen to the advertisements, filter out the right device, and show this value on the screen.Add in a menu for the use to select the device to show.
I have been over this for a week now and as soon as I put it all together I quickly get "Execution Interrupted" and "New interpreter error: MEMORY" along with some more messages.
The idéa is based on the example for the Pixel.JS
I have attached the current version of the code.
This does not print the values on the display yet, I simple connect over BLE and run consol.log(macs,TimerValue) to view what the current collected values are.I have done several version of this.
This one only uses NRF.findDevices with a filter for manufacturer 0xFFFF, as that is what this device advertises as at this stage.
I have also tried making a variant uset NRF.setScan() with simmilar filters, where I exit as soon as one advertisement packets has arrived, then wait 30s before doing this again.
The result is the same.I have also tried running this by "download to ram", "download to flash" and changing things to use save() to free up more ram.
The result is the same.
After a short while, say 2-3minutes, the device is gone and out of memory.When I tested the Pixel.js example I could get the "same" problem. The example updates the display every 60s. Setting the update to say 10s would make that example fail to.
Any help or comments would be appreciated.
/J -
-
-
This might no be a espruino problem, but someone might be able to help.
I have a couple of Pixel.js units that are to display a value from a BLE advertisement packet.
For testing I used some Ruuvi sensors and this works just fine, the script builds an array of senders mac addresses and reads out the temperature and humidity, and then updates the display.But then I got the real device we will listen to. This is based on a BlueGiga BLE112 module running a bgscript.
I have no problems finding the device with the Lightblue app on iOS etc.
I can also see the device just fine with Wireshark and the Adafruit BLE sniffer. I have attached a short pcap file with this data.
But the Espruino will not see this device, or, after days of testing the Pixel.js has found the device once, thats it.The data sent has manufacturer id set to 0x8282 for this test.
The first 4 bytes of the manufacturer data is a timer value in seconds, then some flags and the last byte is a signature that always reads 0xDB.The espruino script is a bit messy but this is in a testing phase... :-)
The air is filled with wifi and bluetooth devises at my office, so during the day the console over BLE is not very stable, it keeps disconnecting. Evenings its better.
So I had a go at the serial console, this worked so so.
On my Windows computer with chrome, it all works ok.
But on the Mac with chrome the baudrate is wrong. The port seam to open with 115200 instead of 9600.
But if I in a terminal run "sudo stty -f /dev/cu.usbserial-AM00LOVW 9600" just after pressing connect in the WebIDE, it makes contact.
While I can get it working, it also failes on downloads every now and then, specially to flash.
">New interpreter error: UART_OVERFLOW"