It seems that the most common application for Arduino WiFi is as a web-server. The idea is that the Arduino acts as the interface to some measuring device or other thing that you want to control from the internet.
However, it is less clear how to use it as a ‘Client’, where the Arduino downloads information from the internet and then processes it.
The Arduino does not have an Operating System apart from a ‘Bootloader’ which loads programs from an external source, such as a PC, and then runs them. All the hardware must be driven by software/firmware that you upload to the Arduino yourself. Once uploaded, the Arduino runs the software/firmware to perform the functions you have designed.
Few programmers know anything about the ‘low-level’ coding of the actual hardware. PC programmers expect their computers to have ‘drivers’ that handle the complexities of communicating with the actual hardware. But the Arduino lacks the memory and processing power needed by this approach.
Fortunately, there are many libraries of free ‘utility’ software for controlling the Arduino’s hardware and for communicating with the Arduino.
Unfortunately, many of these libraries are badly documented so it is unclear which are the most appropriate for a particular application, and particularly how to use them. Even worse, they exist in many different versions according to the exact model of Arduino that you have (and there are very many different models), meaning that often they don’t work and you have no idea why. To make matters worse, the libraries are updated frequently, so examples of how to do things are often out of date. Check the date of any post and be wary of anything that is several years old.
I managed to get the Arduino Uno Wifi to work as a web server and as a web client once I realised that I had to update the IDE from 1.6.5 to 1.7.10.
I could communicate from my PC, but this needed several libraries to be loaded. Also, I loaded the stepper class library to drive the stepper gauge motors that had just arrived. The steppers worked!
I got rather bothered when I found out that the library for the WiFi drivers was apparently incomplete and also that the WiFi library took up a large part of the available memory, leaving little room for anything else. I was advised on one of the forums that I might need to program the WiFi chip manually. I can see how this would save space, because I would need quite a lot of memory to parse the RSS feed, but I have done hand-coding of UARTs in the past and having been there and got the T-shirt, I had no desire to return! I started reading how you could store data in the EEPROM, but this had to a done a byte at a time, so again this looked like a huge learning curve.
Yes, it would be within my capability to do it, but I had no desire to emulate the man who was asked why he was hitting himself on the head with a hammer: he replied that it was so nice when he stopped.
My objective was to make a device, not to develop a skill that I’d never be likely to use again.
Then I realised that I had a Raspberry Pi on top of my wardrobe. I’d bought it on a whim and apart from testing to see if it worked, I’d never used it.
I knew it had a proper Unix/Linux-type operating system called Raspbian – I had some experience with Unix and SunOs from ‘the old days’. Moreover, it had a reasonable processor, lots of memory (on SD card), properly-implemented WiFi (using a plug-in USB dongle) and a decent array of GPIO pins (though not as good as the Arduino).
There is even an on-board development environment called IDLE One downside is that the main programming is Python, which I don’t have the faintest idea about, other than the allusions to the TV series are intentional!
The makers of the Raspberry Pi are clearly addicted to bad puns.
Next instalment to come – getting the Rasberry Pi out of its box.