Hi, I am working on a school project, and I don’t know how to proceed with my ideas. My plan is to have one mbed-LPC1768 process the data and send that data over the internet using wifi. Process the data is easy, on the other hand, sending and receiving is quite tricky. Some of the options at hand are: connect the sending and receiving mbed-LPC1768 to a cloud server but I have no idea how to do it. Secondly, use a peer to peer wifi connectivity between the two over the same subnet using their ip address, I don’t know if this is possible as well. Finally, connect just the transmitting mbed-LPC1768 to an online GUI (web page) or an app to display the process data, I don’t know how to do this as well. In any case I just want the two to communicate or have a way of viewing the information process by just one. Any help will be appreciated.
Hi, there’s a lot to learn but there is also a lot of info out there
There’s quite some work to do to get a LPC1768 to connect to a network by itself - IIRC it has Ethernet capability but needs more hardware components to enable this feature.
How critical is it to send data over the Internet? One thing the LPC1768 has is a Serial port that your code can use to send messages containing the data to a PC (for example) via a USB-Serial converter or via the built-in USB connector. Then you could use the PC to do the GUI/www/etc stuff.
If you really need Wifi or internet you could consider connecting your LPC1768 to an ESP8266 - there’s a relatively comprehensive tutorial here: https://www.instructables.com/id/Using-the-ESP8266-module (amongst many!) although not specifically for the LPC1768. You’d connect the ESP board to the LPC board via serial UART and give commands to the ESP board (which are the same as detailed in the tutorial).
Good luck & I hope the helps get you started!
Hi Chris, thanks for your help. I have the ESP board and I know how to interface it but I dont know how I can send the data to be received by another LPC1768 board over the internet.
The Mbed LPC1768 will need an application board to access the Ethernet (need that RJ45 socket), however it does work well.
ESP8266 also works well here too
However there will be limitations with the LPC1768 on cloud based connections as in most cases you need a HTTPS connection (SSL) and it would be quite difficult to reduce the code required for the TLS handshaking to fit it onto the LPC1768 (you will need 500+K FLASH and 128+k RAM).
You can make your own web server so you will be able to connect on your local network and open the page with an Android/Iphone or PC/MAC web browser.
This may help:
One way to send data over the internet is by using a cloud based database.
Try Firebase, its easy to set up and use and there is a library and example here:
But you will need a different Mbed board, something like this:
Using this method you wont need two boards, send the data to the Firebase Database and then you can use the same mbed board to GET the data back. Its all in the example.
You say “how I can send the data to be received by another LPC1768 board over the internet”
Does this mean you want 2 x LPC1768 at widely separate locations communicating with each other over the internet or… what? You need to describe your intended setup a bit more clearly…
@ChrisTH Yes, but they will be on the same subnet. I have an idea of using remote procedure call (RPC) so that one can be a receiver the other a transmitter.
@star297 Thanks for your help. I will look into it.
Ok, that’s a little easier to picture now…
If all you want is a transmitter & receiver, have a look into UDP - that way you can probably avoid the program size limitation that @star297 was referring to by implementing full-on HTTPS server & client.
@ChrisTH, If I may ask, what is UDP? How can I implement it? Thanks in advance.
@pimani UDP is a network communication protocol. It is suited for applications that require speed like video streaming app. UDP doesn’t do error checking. You may loose some packets. And the receiver may receive packets in a different order.
If you want reliability, use TCP. It is another protocol that provides error checking and guarantees ordered delivery.
I recommend reading mbed Network Socket Overview.
I have a small TCP/UDP example that works on LPC1768. (You need to add a RJ45 jack to your LPC1768 as Paul suggested though.) It should be fairly easy to run this and connect from your PC using telnet, netcat, etc…
I am sure there are a lot more source codes available on the Internet. Do some research and choose a right protocol for your application. Good luck!
Thank you guys for you help.