I have a serial device that I want to communicate with through internet and WiFi.
I want to connect the Photon Tx/RX to my device’s serial TX/RX (both 3.3V) and connect from a socket from a computer on the internet through the Photon and send serial packets to the serial device.
I can set-up my serial device to a certain baud rate so that should be done in the Photon also and then I would like everything that comes in a TCP packet to be sent to Photon’s serial TX/RX.
Pretty much, I want a WiFi to serial converter.
Has anybody done this before?
I am new with the Photon but I can write C and firmware.
This document of mine may provide you with some ideas. In my project, I used a particle core connected via serial to BlueTooth device to exchange messages with a BT enabled micro controller in an acoustic guitar. In addition, the particle core connected via TCP to a private Node JS server which in turn supported a Single Page Application (SPA) running in a web browser using web sockets.
The query function defined on page 33 is formatted in java script in the SPA and travels:
the response does the same in reverse. The trick is in standardizing message formats, especially headers, and adding/subtracting headers as the basic data moves through the various layers and devices. Pages 25-45 of the document may be helpful in understanding this concept.