New interpreter error: FIFO_FULL on the Pixl.js while running the Remote Control Sockets sniffer example #4210
Replies: 1 comment
-
Posted at 2023-06-22 by parasquid I managed to get the remote's binary code using an arduino lying around and the rcswitch library. Using the same codes, I used the rcswitch module in Espruino to switch on and off the relay. Here's what I'm using, if anyone's interested:
I'm still confused with the FIFO_FULL message but now that things are working (and that I know of a workaround if ever I need to do it again) it's not as big of an issue for me anymore. I would still prefer to use Espruino for sniffing the codes though :) Posted at 2023-06-23 by @fanoush Would save a bit of time if you would link the sniffing code directly but I guess it is about this https://www.espruino.com/Remote+Control+Sockets and the Maybe it is good candidate to use the new JIT feature. Try to mark it with The explanation of FIFO_FULL is here https://github.com/espruino/Espruino/blob/master/src/jswrap_espruino.c#L702 "could be state transitions for setWatch" Posted at 2023-06-23 by @gfwilliams
Yes, this is likely it. The FIFO_FULL message comes up when the queue of input events for Espruino fills up and isn't emptied fast enough. That's either text sent over BLE/USB/etc or input events from setWatch. Some RF receivers have 'squelch' (I think it's called?) and when there isn't a signal strong enough they don't output anything, but others just output whatever they see - so if there is no strong signal they're just outputting random noise. In that case you may get so many events so quickly that Espruino can't handle it. Actually adding a ... but it may be that FIFO_FULL doesn't matter. It'll end up dropping some events, but when it gets the correct signal the event rate will go right down and it'll be able to process it - if not the first one then the second Posted at 2023-06-23 by parasquid Ah thanks, sorry about that. I didn't realize I forgot to link the actual page :( I'll see if I can jit this function and if that helps. Posted at 2023-06-23 by parasquid I'm using the same receivers as in here https://www.espruino.com/433Mhz (well they look the same at least) so I'm not sure if they have squelch. I used the same receivers in the Arduino in order to sniff the code. I'm using this Maker Uno from Cytron that has LEDs on each of the pins, and I can see the LED glowing and changing in brightness a lot which probably means there's a lot of noise being picked up. Then again the FIFO_FULL message only shows up when I actually push the button on the remote near the receiver. Of course it's all academic at this point since I got what I needed but I'm still curious about what can be done to get it working :P Just for future reference :) Posted at 2023-06-26 by @gfwilliams So you were using the 433 module from that page? Maybe I should add When you got FIFO_FULL did it print anything to the console beforehand at all? Posted at 2023-06-27 by parasquid I'll see if I can try again later in a few hours, I should have time for it again. It didn't print anything to the console, it shows up as soon as I press the remote. Just in case anyone is curious, I'm trying to make one of the projects suggested there which is the fancy "sous vide" machine :p I got a janky version working with WiFi and the RPI Pico w but it wasn't really user friendly (boot up time was atrocious for some reason) so I'm porting it over to espruino and using a 433mhz socket instead. I'll post a project writeup once I'm fully done :) Attachments: Posted at 2023-06-27 by parasquid Here's a quick screencast of the error. I get the FIFO_FULL as soon as I press the remote button. Attachments: Posted at 2023-06-27 by parasquid Sorry, I just realized you were talking about the module as in js module, not the hardware module. I wasn't using the 433.js module because I got it to work with the rcswitch module. I don't think I had any issue with sending signals. The FIFO_FULL message comes when using the receiver hardware module. Posted at 2023-06-27 by @fanoush So can you just in case put "jit" into the function definition of you can also try to increment some global variable inside sig to know how often it is called Posted at 2023-06-27 by parasquid I did that too, but it still resulted in the same error message. Here's what I used, in case I made a mistake somewhere.
I'll try to see if I can do the count in a bit. Posted at 2023-06-27 by parasquid Here's another screencast with the count. I clicked the remote button twice: first one was before the first time I inspected Also, it looks like even when I'm not doing anything, Attachments: Posted at 2023-06-27 by @fanoush Ok, then it didn't help and is still slow. You can verify the JIT is enabled by typing just the name of function
From c change it can be seen it is >thousand calls per second so the JIT is probably working and the debounce as Gordon suggested might further help. BTW if you would remove "jit" then maybe the EDIT: and BTW no need to put "jit" in startListening, that one is not called in tight loop and JIT eats extra RAM for generated native code. Doesn't hurt in this case, just mentioning it because overall marking everything with "jit" is not a good idea. Posted at 2023-06-27 by parasquid I tried both "jit" and "compiled" but they both still had the FIFO_FULL message.
and you're right, the count is smaller (according to my unscientific estimate) when removing "jit" Posted at 2023-06-28 by @gfwilliams Thanks for trying all that! That is a bit of a shame. It looks like the data is just coming in too fast. I just tried it here with your code and a Pixl running 2.18 with one of the receivers shown in http://www.espruino.com/433Mhz and I can get it to work... It does show FIFO_FULL, and it doesn't always pick up the button presses - but if I press the button on the transmitter a few times it does tend to pick it up eventually. What I did was used your code, but removed
You can also try Not having It's also interesting to see that the console gets pretty slow/unreliable - the data coming in is just too fast for it. Checking on a scope I see pulses coming it at around 1kHz - so it'll be calling ... and interestingly using the 433 module doesn't work at all for me :( I'll see if I can add 'jit' in it Posted at 2023-06-28 by @fanoush However the idea with debouncing is good? If you are sending 0/1 bits with some known minimal pulse length then debouncing to something less could save the CPU quite a lot by not firing the setWatch callback for shorter pulses? And maybe even filter out some noise so even some bits could be received despite the noise? Posted at 2023-06-28 by @gfwilliams
I did try this, but it didn't seem to help noticeably - I think because the signal from the receiver already maxed out at 1kHz or so, and you couldn't debounce for more than that because that's about the rate that data comes in. Posted at 2023-06-28 by parasquid
Oh, I haven't actually tried all of the buttons :D (all I'm interested in were the first two since those were bound to the socket's on and off switch). I'll try and see later if at least some of the buttons do work. I'll also try the connection interval setting. Maybe even fanoush's suggestion of moving serial to a usb adapter might help. Posted at 2023-06-28 by @gfwilliams
Yes, if you can avoid having a BLE connection that would help. As it's a Pixl you could not connect anything and just take a photo of what it prints on the screen, since it'll write to that if you're not connected to anything Posted at 2023-06-28 by parasquid Unfortunately I still get the FIFO full message even when disconnected from ble and having the output on the pixl's LCD :( Attachments: Posted at 2023-06-29 by @gfwilliams
Yes, you would do - but that doesn't mean it's stopped working - it just means that at some point it got a bit too much data for it to handle and dropped some, but it still stays working. Do you not manage to get any output at all when using your transmitter? Posted at 2023-06-29 by parasquid
No, none at all unfortunately :( With all the buttons and trying to press it over and over. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-06-22 by parasquid
I've tried to do a forum search but it seems that they're quite older.
I'm trying to find out the codes my remote uses for my rf socket, but when the remote is in range and I press a button, I get this error in the console.
I'm not really sure how to debug this. Is there a way to recompile the firmware to increase the FIFO buffer?
I'm connected via the realtek bt adapter (so i don't need to throttle send) just in case the mtu made a difference, but it's still the same.
Would moving serial from bluetooth to a serial adapter help at all?
I also just tried to send to flash, disconnect from the ide, rebooted the pixl.js and then tried the remote. I still get the FIFO_FULL message but this time on the pixl lcd so I'm guessing the serial or bt connection doesn't make a difference?
Beta Was this translation helpful? Give feedback.
All reactions