Open ghost opened 8 years ago
Same issue on Banana Pi with Node 4.4.7. I'm able to receive but not to send data.
Same Error: sent to mote <Buffer 00 0c>
Hello, is there still some activity here? I've got the same issue on RaspberryPi 3 with Node 7.2. Receiving works, but sending reports a timeout error. Has sending ever worked? I've tried only the LowPowerLab profile, not the default yet.
I'll try to submit an update in the next day or two. I've had sending working for a few months. It's mostly stable, but can get locked up from time to time. I'd welcome a pull-request to make it more reliable.
thanks! I have nearly no experience in JS, so the code is hard to read for me... So what I checked today:
So if your version is working better now I would like to test it also.
I've updated the repo. I'll have to look into code implementation later when I have more time to remind myself how implementation details may have changed.
I use the low power lab profile exclusively, so that should be the most reliable.
Ok, I have tried the updated version, but I still get the timeout error message. The send function waits for a packet sent interrupt, but the int is not enabled for the send. So I enabled the setInterrupt(true) in the init.js for the send function. Now I get the packet sent message, but I run into packet re-transmissions five times until the re-transmit error. So there must be something more in the program flow for the send acknowledge.
So the sending works, but the javascript interrupt service is slow. From start send to clear int it takes about 4 ms, my µC is sending the ack faster and so it gets lost many times. I've tried another project now with a driver written in C, there the same response takes 200 µs (on my microcontroller LPC812 @30 MHz it takes 100 µs).
@JojoS62 That's good information. I'll do a little bit of work to see if I can speed up the library's ability to quickly get back to listening mode.
What is on the remote end that is sending back the ACK so quickly? Is that the LPC812? And am I right to understand that the ACK should ideally be received by ~ 100µs?
@PIPOKID After looking into this more (sorry for the long delay), it looks like you need to enable listening in order for the library to register the ACK coming from the remote end, otherwise the send is considered timed out.
The sample code you provided has the listen function commented out ~ line 22.
I'll make a note to remove the need to enable listening in a future update, but for the time being it's required.
about the ACK response time: I have not seen something like a spec for the protocol with the original RFM lib, so I would say it depends on your nodes. I think the faster the response the better, but if some clients need some more time switching form transmit to receive you will run into re-transmits when the ACK comes to fast. For a simple sensor/actor node it will be no issue to wait a few milliseconds before sending the ACK. I digged also deeper into the original lib because I use a fork for the Cortex-M MCU instead of the ATMega. There I've seen also that handling the ACK is not clean, the canSend() always causes a state change in the first call and is then called again. There was some discussion in 2014 in the LPL forum, but Felix did not accept the PR. This makes the reply also slower as it could be and more worse, it clears the received data so that you have to handle or copy the received data before calling the sendACK. About your JS code: as far as I understood, there is a list of listeners for the interrupt. Is there a use case where multiple listeneres make sense? Otherwise simplifying this IRQ handler could make it faster? And when I played with the module, calling setInterrupt(true) more than one time results also in registering and calling the handler multiple times. Now I'm using this piGateway from https://github.com/abouillot/HomeAutomation on my Raspberry. This gateway is written in C what is easier to understand for me. The messages are sent to MQTT and so also available in the JS world.
Hi, is there a working library available now?
Hi, I'm trying to get a RFM69HCW radio from HopeRF working as a trasmitter in the following environment:
Raspberry Pi 2 Model B (raspbian jessie, release from 2016-03-18) node --version = v4.4.2 npm --version = 2.15.0 uname -a = Linux raspberry 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
Along with an Arduino which works as a receiver and has been tested with another arduino that worked as a trasmitter.
I'm using the following node.js test code:
And the following Arduino Receiver code:
And the node.js output is as follows:
Can you @losttime or anyone else help me understand what I'm doing wrong? Thanks.