Following on from earlier articles – this is as much a collection of notes than anything else – and there’s a demo video in here of the SD1306 using the Luma library on the Orange Pi Zero. After months of thinking the only SBC I’d get working with I2c was the Raspberry Pi it transpires that I was miles out and more and more boards are succumbing to cheap display nirvana.
Some time ago I tested Mongoose OS, early days and I had a lot of difficulties. This blog is a partial re-write because I see no reason to leave information lying around that is well out of date – there is a lot of that on the web already – and the current setup is MUCH easier to use than before. I have to tell you that the version changed as I was writing this so make sure you have the latest mos.exe
Flush with success at writing trivial code on NEO platform to control lights and displays, in Python, I thought I’d have a go at microPython on the ESP8266 and the ESP32.
Getting this working on the ESP8266 was trivial as the binary files start at zero – so really you just have to use your favourite tool to flash the chip (this is not the place to teach anyone how to flash chips incidentally).
The Trip: As regular readers may know, early in 2016 I worked in Spain on a contract with some great guys to analyse information from ESP8266 chips. Without going into any commercial detail, this is what I brought back from that trip as well as other lessons learned since then.
The scenario: The tests were done on a series of ESP-01 WIFI micro-controllers in a rural environment, initially with a bank of 40 ESP-01 boards. These were powered by a single 20 amps 3v3 power supply. Yes, a switched supply. The boards were mounted on Vero-board and power applied. No linear regulator to smooth out the crap ( I would normally run 5v switched and a linear 3v3 regulator on-board for each device), lossy tracks on Veroboard, signals interfering with each other.. except it DOES get worse - read on.
The Place: The location we conducted our tests was off-grid, relying on solar power and a generator - and the weather most of the time was cloudy - that meant at regular intervals the remote generator kicked in and when it did a couple or so mains cycles were lost as the set-up there uses a combined inverter/charger. The result of that was that at regular intervals, the router reset.
Aside from actual power cuts you don't get much worse than this. At first when we switched on the boards - which are running a modified version of my home control software which is in turn based on TUANPMs MQTT code with a boatload of stuff added and a lot of tweaking over time, only some of the boards would report back. A quick check of the router revealed that by default it only allocated enough room for 32 connections on DHCP. That was quickly doubled and lo and behold, all the boards logged in by MQTT to the PC (running Node-Red and MQTT and firing off data to a database).
Useful outcomes: Well, any thoughts I may have had concerning reliability completely vaporised this last 2 weeks as day after day our little bunch of 40 boards (not even all from the same supplier as some were blue, some were not) just sat there constantly delivering information. This was soon increased to a wopping 120 boards without issues.
So if you're just starting up with ESP chips - bear the above in mind before jumping to conclusions about board reliability. The boards used in the test, running as I speak, were the early 512K versions, today I always use ESP-12 boards in my own projects as they have eight times the amount of FLASH which means OTA, big programs (up to 1MB of C code (that's a lot)) and in the case of the "F" version arguably better antennae.
I sometimes hear of people complaining that once programmed, some ESP boards go into a loop at power up - and I've recently had this happen to me TWICE. In each case I had extra bits and pieces attached and was running the board off the FTDI - again in each case, putting proper 5v onto the boards immediately resolved the "problem". FTDIs vary a lot in their output and voltage. While it is tempting to use them to power the ESP (or indeed the micro-usb connector in some cases, straight off your PCs USB - the time will come when this causes trouble and now you know the answer.
I made this as a continuation of my current work with the NEO2 but there is no reason why this could not be adapted to other boards. There are also many ways to achieve the same thing i.e. colourful terminal login – this is merely a what I chose to do.
So I like colourful terminals when working with little boards like the Raspberry Pi , NEO and many others. I’ve long since gone off using the graphical interfaces (unless I’m making a media centre) – and play with the boards mainly from my Windows PC using WinSCP which gives me graphical access to the file structure and the ability to use Microsoft Studio Code (I used to use Notepad++ but that was, it seems, a lifetime ago).
I’ve separated this off as it has gained a life of it’s own. When I originally opened up the NAS box from FriendlyArm and plugged in my NEO2 (same company) I’d just planned on trying out the free NAS software. Little did I know how far this would develop…
We live in a world of colour and most of us have colour monitors. Why then should we put up with boring terminals? Check out this coloured prompt code.
My first NAS was the NetGear ReadyNAS duo – some of you may recall this – possibly with mixed feelings – it wasn’t the fastest tool in the box and mine was one of the earlier ones which had the peculiarly stupid “feature” of not turning on until you pressed a button - how dumb is that?
What, not ANOTHER board from FriendlyArm? And yes, you’d be right to wonder why I’m doing a bunch of articles on them right now – well, it just so happens I got a box of stuff all at once so I thought I’d get them all out of the way at once.
I have covered the FriendlyArm NEO and NEO2 boards here before now and generally been in favour – but for one little item in common with many other boards – little or no IO support – well, that just changed. Read on…
With no apparent way to get to the IO on this cute little board, I promised I would write to FriendlyArm and ask for WIRINGPI and that I did. In the meanwhile if you take a look at the relevant blog entry you’ll see I made a start at using GPIO the hard way and even found a WIRINGOP (OP – Orange Pi) variation that would do basic IO if you could guess the right IO pins, but that was about it.