New ESP32 Wemos Module

I ordered an ESP32 module from Ebay:

http://www.ebay.co.uk/itm/WeMos-D1-Mini-Mini-Pro-Compatible-Shields-Now-with-Triple-Base-and-ESP32-/322729576423?var=&hash=item4b242e87e7:m:mTDnl7ewzGuk9vFvBSGmXCA

This module is packaged as WeMos compatible board. I’ve used the Wemos ESP8266 modules previously and they provide a neat stackable package with a few pre-built modules for SD card readers, OLED displays, etc.

Plugging the module in and viewing the serial data on boot at 115200 baud shows that ‘Happy Buddha Trading’ appear to install some test software on the device. It doesn’t seem to create a Wifi hotspot, but it does activate the Bluetooth module, which I can view from a phone but not pair to.

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:160
load:0x40078000,len:10632
load:0x40080000,len:252
entry 0x40080034
BTDM CONTROLLER VERSION: 010101
btip start
copy .data from 4000d890 to 3ffae6e0, len 00001830
set .bss 0x0 from 3ffb8000 to 3ffbff70, len 00007f70
BTDM ROM VERSION 0101
BD_ADDR: 24:0A:C4:01:61:0E
NVDS MAGIC FAILED
RF Init OK with coex
Enable Classic BT
Enable Low Energy

Tested by Happy Buddha Trading

ESP32 Chip ID = 0C6101C40A24
ESP32 SDK: v2.0-rc1-803-g1e0710f1
Bluetooth LE Device 'ESP32_SimpleBLE started

Starting Wifi scan
Scan complete
2 networks found
1: TV License Surveillance (-69)
2: TALKTALKC4B0EE (-77)

ESP8266 Arduino `.text’ will not fit in region `iram1_0_seg’ Error

I’ve been writing some software for a Wifi based CAN data logger for the ESP8266 in the Arduino platform, and have been getting a bit of a strange error. It appeared to be related to using the std::string functions in my code – and although I have used this in other sketches without issue, I suddenly received the following error as soon as I simply declared a std::string variable:

c:/users/scott/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Scott\AppData\Local\Temp\build525647f6f8500d071cfab5cccf314276.tmp/ESPCANLogger.ino.elf section `.text' will not fit in region `iram1_0_seg'

collect2.exe: error: ld returned 1 exit status

A bit of googling appears to show that this is something to do with where those std libraries are stored in the code memory of the ESP8266 (I don’t fully understand the details of the chip). The issue is described in this issue in the Arduino ESP8266 github issues log:

https://github.com/esp8266/Arduino/issues/2794

There is a fix shown in this pull request

https://github.com/esp8266/Arduino/pull/2804/files

I had a bit of trouble locating the file referred to, because the Arduino boards manager doesn’t appear to store the added boards in the Program Files location anymore, but these are now located in the AppData folder in your user profile (on Windows 8)

C:\Users\USERNAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\tools\sdk\ld\eagle.app.v6.common.ld

The line which appears to fix it all should be added around line 163:

*libstdc++.a:(.literal .text .literal.* .text.*)

So my file then looked like this:

*libsmartconfig.a:(.literal .text .literal.* .text.*)
*libstdc++.a:(.literal .text .literal.* .text.*)
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.text.*)

There is some more detailed explanation about memory inside the ESP8266 here: https://tech.scargill.net/esp8266-ram/

ILI9341 and XPT2046 TFT display on ESP8266

For my own future reference more than anything else, to get the ILI9341 (either Adafruit or otherwise) working on the ESP8266 using the Arduino development environment isn’t completely straightforward. I knew I had this working previously, but couldn’t find the info again, so am copying it here.

It would appear that the ILI9341 library currently available through the Arduino Sketch -> Include Library -> Manage Libraries is not currently compatible with the ESP8266. Thus you have to download the working library directly from the Adafruit Github repository. However, I also had issues with this version. Finally I used the examples on http://nailbuster.com/?page_id=341 to get it working.

Additionally, the XPT2046 library available in the Arduino manage libraries feature does not support Hardware SPI, however there is an alternative developed by [spapadim] on Github. I took the following steps to compile some example code.

  1. Wire up ESP and Touch screen according to http://nailbuster.com/?page_id=341
  2. Download the zip file from the end of the page on http://nailbuster.com/?page_id=341 this includes some working examples
  3. Download XPT2046 library from Github https://github.com/spapadim/XPT2046
  4. Go to Arduino IDE -> Sketch -> Include Library -> Manage Libraries -> Search GFX and install the “Adadfruit GFX Library”
  5. Open the example sketch from Nailbuster and compile and upload

I have a feeling these libraries may be a little out of date now so I’ll have a look at whether they can be updated to use the latest versions available from Adafruit.

Briggs Transparent Cylinder Head Engine

I’ve been following a series of videos on YouTube of a couple of guys who have been busy building a Briggs and Stratton engine with a transparent cylinder head. They’ve now got it running surprisingly well:

Further to this, another YouTuber has build a transparent cylinder head Briggs engine and filmed it in 4K then run it on Gasoline, Alcohol and Acetylene . Well worth a watch:

Thoughts on Graphical/Visual Programming Languages

​I dont see a lot of information on personal blogs/diy projects regarding the use of Visual Programming Languages, but this is what I use in my current role as a Control System Engineer developing engine control and test systems. I actually call them graphical programming languages, so if I use the terms interchangably here then I’m actually talking about the same thing. We use visual programming languages for engine ECU control code and Test Cell control code (Simulink + Stateflow and Labview respectively). I believe graphical programming languages are pretty widely used in the automotive industry, and appear to have massive buy in from plenty of other industries too. I think its easy to see why.

Continue reading

Separated Rotary Engine

This is a pretty interesting concept – very similar to a ‘split cycle’ engine – basically the rotary version. A split cycle engine has the benefit of being able to split the compression and expansion cycles of a traditional internal combustion engine. This allows for different geometries in the combustion and expansion chamber, allowing for things such as very high expansion ratios verses compression ratios, and also potentially volume combustion in the case of this particular engine.

It looks as though this engine would still suffer some of the difficulties of traditional rotary engines, but still a very interesting concept!

ESP8266 Successor – ESP32 released with CAN bus support 

So, the interesting little ESP8266 WiFi SoC finally has a younger brother which appears to be even more capable. Among other expansive updates, the 32 bit Dual Core microcontroller still supports WiFi, but also Bluetooth Low Energy, a DAC, many more ADCs, GPIO pins, etc. etc. Lots of good details here: http://esp32.net/ 

Continue reading