• We're all familiar with the challenges of using those el cheapo RF transmitters on the Espruino. Really, the problem is more the receiver than the transmitter - the Espruino just struggles to handle the noise fast enough to receive a signal. Listening continually is out of the question.

    I'd already made AzzyRF, my terribad RF OOK protocol. Now that I'd been playing with ATtiny841's over in the Arduino world, I realized that the cheap, serial-capable chips could be used as an RF gateway for the Espruino (or other device).

    It seems to work reasonably well - I can have it listen to the receiver, and forward any valid packets to serial, or it can respond to commands over serial and transmit them.

    My question now concerns the serial protocol - what is a good format for this that would make sense?

    Right now I've got a very crude system that just prints out successfully received packets as $(data)\r , while commands like S(4 bytes)\r, L(7 bytes)\r, etc send packets (AzzyRF has 4/8/16/32 byte packets), and C(27 bytes)\r to write new config data to the EEPROM. I expect that I'd have a few more config commands (to allow configuring more-frequently-changed options independently) and stuff. Does anyone have any recommendations on how to write a sensible protocol? I'm particularly interested in conventions that I should be following - is there a recommended command format? Newline conventions? Other stuff I should think about?

    The sketch, and some trivial espruino js to enable sending arbitrary bytes down serial, are in my github:

    https://github.com/SpenceKonde/AzzyProje­cts/tree/master/433mhz/txrxtoserial21

    I'm going to have a few boards made that just have an '841 and headers for the RF modules + comms - I figure if nothing else, I'm planning to use my AzzyRF a lot more now that I've got all the infrastructure in place.

About

Avatar for DrAzzy @DrAzzy started