• Yeah, honestly I know as much as you about that. From my impression of ESP8266, you just take your protocol and put AT+ on the start of every command :)

    I think:

    • \r ends a line, but you probably want to cope with \r\n too
    • OK\r returned on success, ERROR\r returned on failure
    • When you're 'pushing' data back, prefix the line with +

    What is LLAP?

    It's just Ciseco's home-made protocol. It's worth following the link in my original post though - you might get some ideas.

    Personally I'd just forget everything and do what's simple though. As long as it's easy for people to use it doesn't really matter if it's like any other protocol.

    Oh shit, I can't just send the binary?

    Well, you can. My guess though is in your receiver you'd do something like:

    char buffer[256];
    int bufLen;
    
    void loop() {
     while (Serial1.available()) {
      char ch = Serial1.read();
      if (ch=='\r') { 
        buffer[bufLen++] = 0;
        executeCommand(buffer);
        bufLen=0;
      } else {
        buffer[bufLen++] = ch;
      }
     }
     // do other stuff
    }
    

    And then you're stuffed if you want to send a command likeHi\r\0... You can obviously work around it though - you just might find that sending/decoding hex is actually easier.

    RTS/CTS

    • RTS = ready to send
    • CTS = clear to send

    It's almost like an IRQ and a ready line. So:

    • your receiver gets data and wants to send it to Espruino
    • It raises the RTS line
    • Espruino wakes up, gets its act together, and raises the CTS line
    • Data is sent
    • It lowers the RTS line
    • Espruino lowers CTS and goes back to sleep if it wants to

    edit: but it's not a big deal... Maybe you don't care about sleep power consumption - or you could even hack something up by sending a few characters you didn't care about (which could wake Espruino), then send the data you want later on.

About

Avatar for Gordon @Gordon started