Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 6 months ago.
Data sent to web page for viewing
Hi all,
I require some help regarding communications and viewing information on web pages. My project involves taking a measurement from a tank which is remote in a field. I then need to enable a user to view the information. My idea is to send the information to a web page in some way. That way a user with internet access will be able to view it. I'm sure this is probably simple to some of you and although I have trawled through the internet and the mbed web site I am struggling to get a grasp of the basics. What information I find just dives straight into the complicated stuff!
Can anyone give me a description of what is required and what techniques I should be looking at. I've tried to read up on HTML, HTTP, Websockets, etc but it's a little difficult to find out exactly what I need.
I am using a mbed LPC11U24 as its better suited to wireless applications. I'm taking a reading from an ultrasonic sensor which needs to be sent fro viewing.
Any help would be great.
Thanks Rob
2 Answers
11 years, 6 months ago.
Hi Rob,
A couple of concepts come to mind (qualified - I have the LPC1768, so not sure if there may be any special constraints for the LPC11U24).
Requirements
You mention wireless, but didn't indicate what the range is from the remote sensor, or what power may be available. These may be the biggest drivers for one solution over another. Will it be battery powered, solar charging, or is a/c available?
- Near a PC or other "base station": Bluetooth could be a good option - paired with a node that has access to transfer the data, and then it is made available on a web site.
- In a mesh network to hop the data: ZigBee, or one of the other low power technologies might be a suitable medium for transferring the data, and then it is made available on a web site.
- A bit further: Wifi might be the next step for range, or flexibility. Here too there are some different options.
- Even further: GSM or cellular technology to transmit the data.
I'm sure you used the search and the Cookbook - Wireless, which may be one of the best links to continue the research.
Wifly
I have been working with the Wifly module, so what follows is based on my experiences. Here a few more choices come to mind:
- The Wifly module itself has the means to post data directly to a web server (Wifly User Manual section 4.4). In this scenario, the mbed configures the Wifly module to do just that, and then the Wifly module pretty much does the rest, maintaining the data on a web server. You of course need an application running on the server to catch the data and make it available to the users.
- The Wifly module could simply be the link, and your software on the mbed posts the data to the web server. In this scenario, the mbed might be running HTTP Client. This version of which is one of many derivatives you'll find with Search - httpclient. You also need mbed official WiflyInterface or my derivative of WiflyInterface, and check out the Cookbook - WiflyInterface.
- Your Wifly-based module could could be the web server. In this scenario, the module provides the link to the internet, and the mbed hosts a small web server. This is the most restrictive model, based on the limitations of the Wifly module - it supports only a single connection at a time (one client, and 'embedded' objects like images are difficult at best). There are two web server libraries that I know about - Smart WiFly WebServer (one I'm quite familiar with), and HTTP Server (which I haven't used wirelessly).
So, while you see I've had some experience with one of the possible technologies, I encourage you to explore all the options, and hopefully others will weigh in as well.
Thanks very much for your answer. That's a great help. I did leave out some pretty important points! :)
The distance will be around 1.7 miles (a bit under 3000meters) so it is quite far. It rules out Bluetooth anyway. In the future it may involve many mobile devices in the field but at the moment the project is designing it for just one, so will need to travel that distance in one hit. The WIFI or GSM was what I was initialy looking at. I had looked into using a RF transmitter on the mobile unit and have a RF receiver somehow attached to the laptop. But after looking at it, it appears that unless you have line of sight its quite difficult. Which is one of the reasons I wanted to simply send all the info to a web page and then anyone with internet access can look at it. I noticed (a long time ago) that the mbed became compatible with a 3G dongle (which I brought) so thought this might be an option but after looking at the info and the sample programs I still found myself a bit lost.
I also looked at some of the pre-written programs on the website as writing one from scratch for myself would be pretty much impossible. I'm hoping I can find what I need and import the program and 'fiddle' with it to achieve what I need.
As always, any further advice is greatly appreciated :)
Rob
posted by 01 Mar 201411 years, 6 months ago.
Thanks very much for your answer. That's a great help. I did leave out some pretty important points! :)
The distance will be around 1.7 miles (a bit under 3000meters) so it is quite far. It rules out Bluetooth anyway. In the future it may involve many mobile devices in the field but at the moment the project is designing it for just one, so will need to travel that distance in one hit. The WIFI or GSM was what I was initialy looking at. I had looked into using a RF transmitter on the mobile unit and have a RF receiver somehow attached to the laptop. But after looking at it, it appears that unless you have line of sight its quite difficult. Which is one of the reasons I wanted to simply send all the info to a web page and then anyone with internet access can look at it. I noticed (a long time ago) that the mbed became compatible with a 3G dongle (which I brought) so thought this might be an option but after looking at the info and the sample programs I still found myself a bit lost.
I also looked at some of the pre-written programs on the website as writing one from scratch for myself would be pretty much impossible. I'm hoping I can find what I need and import the program and 'fiddle' with it to achieve what I need.
As always, any further advice is greatly appreciated :)
Rob