Spinneret as datalogger, htm accessible remotely?
T Chap
Posts: 4,223
I am exploring using the Spinneret in an application to store some data at a remote location, but I have little info on what will be allowed as far as access to the LAN and router. Access to modify settings in the router may not be possible. I am assuming it will be easy to get the Spinneret connected to the router( maybe using a wifi go between module). The idea is to send to the SD card a time stamp, opcode for user inputs to the main board, opcodes for error conditions. Then when there is a need to review the log, instead of having to pull out the SD card, or scroll through an LCD looking at the list, just view it online. Ideally, viewing online from anywhere. But, viewing online from a locally connected computer would be second best. If it is a dynamic IP, what other options exist to view remotely from anywhere? I was considering uploading each new data event to a mysql database which the Spinneret should be able to do, then view the database instead. Any thoughts would be appreciated.
Comments
Another idea I have not yet tried, is to have the Spinneret do web activity or something so the IP lease is extended indefinitely. Not sure if this is allowed, and there would always be situations I'm sure where the lease lapses and you have to somehow find out what the new IP is (have Spinneret check IP address periodically, send new address via email if it changes?)
Nate
I used the mysql approach in the past. In this case the spinenret received data via SMS, and sent the data to a remote server.
In the spinneret help there is a tutorial about using the get method to send data to a page.
The landing page would take care of it. In case I can dig my code and post it.
The down side is added complexity and a bit of PHP or .NET coding but very simple stuff.
I saw your post first up but just waiting to see what suggestions you end up with. I am already doing this datalogging and internet access with my Tachyon Forth on a W5200 although I had originally experimented with the W5100. Basically the files are accessed via FTP and you can configure FTP as a virtual drive/path from your client. Web access is available for status and maybe configuration although the TELNET port can access all functions.
1. Yes, the Spinneret can be used in this way.
2. There are other protocols such as FTP or TELNET better suited for data collection but HTTP is available.
Now that we have established that we have hardware and software capabilities then routing is infrastructure dependant and really is simply a matter of implementation which is addressed by gaming and SIP networks for instance. Having a known fixed IP which may even be a third party matchmaking system is a start. So many different ways of handling this and so many different systems. The logger would obviously have to identify itself (MAC) and in the process reveal it's WAN IP and may even rely on UDP as well etc. I have the luxury of fixed IP installations globally so I don't really have to worry about this.
Anyway, the client side GET gets around firewall and networky stuff. Add DHCP and client DNS to make the system a bit more dynamic.
Spin for wifly output:
php page
Here is a screenshot of an html page that allows very easy updating of a database row of values. The Prop has a method that reads the database at some frequency, in which you park some values for it to read. For example, if you want to update the time, fill out the html page with the correct values, then submit to the database. The Prop will read it when it you have it set to do so, and it will parse the data for the Command(opcode for update time), then overwrite the time with your value. Obviously the seconds could be off, but the minutes will be close if you have the Prop reading once per minute. Other commands can be set in the Opcode field for the Prop to read at x frequency. Then once the command is done, the Prop will update the database with a flag value that can be read from a simple html page later to find out when and if the Prop got the command. This makes an indirect method to control the Prop without having access to the router ssid/pw, port forwarding etc( assuming you are using an ethernet cable). Hopefully these old wifly methods will adapt easily to the Spinneret, as the goal is to store data to the SD card, update to a database simultaneously, but have the option to "Upload All SD to DB", upload any particular line of a text file to DB, etc. Then, if the server or router is down, the data still goes to the SD card.