• AT+SEND

    If you google for AT+CIPSEND (the TCP/IP send command) you might get some ideas, but I'm not sure it's much of a standard :(

    The way ESP8266 does it is (for single sockets):

    • Send AT+CIPSEND=nBytes\r
    • Wait for receive > (in reality you probably don't actually wait for that)
    • Send the bytes
    • Wait for receive SEND OK

    So there's actually no need for hex encoding with that at all.

    However for SIM900 GPRS here they use AT+CIPSEND without a length parameter, and it looks like you have to send Ctrl+Z to break out and actually send the data - I don't know how they escape it if you want to actually send Ctrl+Z though.

    CTS/RTS... Wait, couldn't that be done with 1 pin?

    Maybe... I guess once the pin is forced low it's hard to tell when the transmitter has then stopped trying to pull it high... You could do it a bit differently:

    • Have an interrupt line
    • Raise that when you have received data
    • Espruino wakes up, and actually asks for the data that has been received (rather than being sent it).

    Or you could even just raise the IRQ line 10ms before you start sending data - that'd be good enough too.

About

Avatar for Gordon @Gordon started