0

In my project I have a teensy 3.1 reading and decoding NMEA strings coming in from an EM-406 GPS module. That data, after being decoded, is sent over serial through an xbee into my computer where I can then read the data out in my terminal. Now this is all well and good and I am sure some cool projects can be made, but I want to go further.

After the data is coming into my computers serial port, I want to pipe it into my web server so I can have my GPS data interact with the Google maps javascript API. The only issue I am having is figuring out how to get a constant stream of data from my local machine into my server.

I know about rsync and scp and tools like that, but those don't seem like the right fit since (to my knowledge) they work on updating and/or moving files around. In contrast, I need something that will have a consistent open connection that I can freely send data through, like a network serial port (is that a thing and I just answered my own question?).

I am assuming I can use ssh in this situation but I am not sure how to approach that. Does anyone have any suggested reading or an idea that could give me a nudge in the right direction?

4
  • I don't know any software for that. But what you describe should work e.g. via some (permanent) SSH Tunnel, so you might want to check for that.
    – Izzy
    Commented Oct 21, 2016 at 16:38
  • Ever heard of WebSocket?
    – wb9688
    Commented Oct 23, 2016 at 20:48
  • If the network you are talking about is an internal one (not the internet), you can look at the socat command which streams data over a network or between serial and network.
    – meuh
    Commented Oct 24, 2016 at 17:40
  • It is over the network, but of my approach in this is to teach myself about network communication, it's never going away so mine as well try and understand it. I fell towards the idea of sockets though, they really seem like what I am looking for
    – Mike
    Commented Oct 25, 2016 at 13:43

2 Answers 2

0

I would suggest a python script with the pyserial and possibly the requests libraries although there are plenty of web interfacing libraries in the standard libaries.

All of the above are Free, gratis & Open Source and cross platform so should work on anything.

You can have one thread listening to the serial port and assembling transactions into complete ones and a second connecting to your web server via http post messages, if that is what is is expecting, to send the complete, possibly reformatted or otherwise processed, transactions to the server. If the server is expecting a file upload or just about anything else you will be able to do that as well.

There are also a number of python libraries for direct use of the Google Maps API.

1
  • 1
    Yea that is pretty much exactly what I am looking for. I did stumble onto pyserial and have already starting reading up on it. I figured I would let the flow of the code dictate how I want to manage processing data, if it makes sense one way over another then I'll go down that rabbit whole
    – Mike
    Commented Oct 24, 2016 at 13:21
0

Well, this solution is obviously not exactly what you are looking for, but it streams the serial dataflow to the network http://www.serial-com-port.com/
You may work with any serial port you have over your local (LAN) or IP network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.