I have a radio link between two arduinos. The link can either be high or low. The radio is not so good. If i try to send 125ms pulse the arduino on other end will get PulseIn of 130ms or 120ms.
Good thing about this radio is that the signal comes out clean and the radio takes care of encryption and authentication.
What kind of transmission protocol can i use?
I would need to transmit key presses. There is total of 32 keys. I would need to get key states at least every 200ms
what radio module do you use?
>>53602045
24YK-RT/RX
>>53602389
Forgot to say i only have one pin free on the arduino so i have to use some kind of serial protocol.
>>53601841
Dude just say you're doing a keylogger, don't dance around it.
And even if you aren't (a wireless keyboard makes sense too) couldn't you theoretically just stream the raw USB data±? I haven't done much wireless work but with only two streams you should be fine
what type of arduino are you using, also something fishy about the module plz post the page you bought it
why no nrf24l01+?
there even exists a fuckin nice library
https://tmrh20.github.io/RF24/
>>53603292
nvrmind found it on aliexpress, so considering thats its a 2$ module:
1. the crystal inside the module is not consistant or
2. the arduino is too slow and cant keep up
3. trying to debug with the serial too might be slowing down your arduino
4. your transmitter might not be fast enought to & transmit (?)
5. RF interferance from outside source (could be your pc or some cable line near you)
Either way troubleshooting RF is like magic.
Usually, you just make your own protocol.
Points to consider:
If error detection is already done by radio hardware, things already simplified.
You only need to check if error data are discarded and need to re-transmit.
If no error detection done in physical layer (radio hardware), you'll need to prepare for some sort of parity/crc/etc.
Usually, people will use fixed width data for easier programming.
You'll have header byte(s), data type, data value, correction code, tail byte(s).
Head and tail must be unique value, so make sure no value collision exists.
Again, it's easier to use ascii (or utf8) rather than binary so you can avoid such collision.
eg:
head = $
data type = 02 (button 2 pressed)
data value = 1 (1 = button pressed)
tail=;
So you need to send $021;
>>53603333
oh sick you can use this for ghetto BTLE with small amounts of data, and there are a few arduino wrappers for the code. And they're not even a fucking dollar from china. Thanks anon!
I have found DNP3 to be useful for radio though it can be a pain. With Modbus you would either lose data or only get a poll update every X polls. Anything that happened in between is gone. DNP3 can cache data and sends all data stored with that class when it is polled.
>>53603665
No problem, m9 :^)
I really like em. Even connected an arduino to the internet with those chips, kek.