Saturday 27 June 2015

CaptiveIntraweb: New firmware, new scripts & new videos

Providing Android compatibility (while IOS workes always worked) turned out to be easy in the end. So it is time for a 1.0 release of the project files:

  • Find an all-in-one package with scripts, html-pages and firmware in the master-branch of my github repository.


  • In this video, you see me setting up the Olimex MOD-WIFI-ESP8266-DEV module. As described earlier these modules come with 2MBytes of flash memory.


  • While in that video, you see me using the portal on an IOS and an Android device to show the now fixed Android support.


Monday 22 June 2015

CaptiveIntraweb now running on Olimex MOD-WIFI-ESP8266-DEV

I finally found the time to try the new firmware on one of the two Olimex MOD-WIFI-ESP8266-DEV boards.

  • I decided to mount the headers upside-down to have the silkscreen readable when I have it plugged into the breadboard.
  • Flashing the firmware worked as expected. (GPIO0 / Pin21 hardwired to GND - That's ok, trust me.)
  • Formatting the i2c flash file system tool longer than expected. That worried me for a second or two.


The board then came back:
 NodeMCU 0.9.5/AReResearch build 20150318 powered by Lua 5.1.4  
 lua: cannot open init.lua  
 > file.format()  
 format done.  
 >   
 ----------------------------  
 No files found.  
 ----------------------------  
 >   
 > r,u,t=file.fsinfo() print("Total : "..t.." bytes\r\nUsed : "..u.." bytes\r\nRemain: "..r.." bytes\r\n") r=nil u=nil t=nil  
 Total : 1513781 bytes  
 Used : 0 bytes  
 Remain: 1513781 bytes  
 >   

Woooooha! 1.5MBytes of free space! Just think of the possibilities!

Next thing was to try the CaptiveIntraweb scripts. So I uploaded the files, ran "ap-mode.lua" to set the WiFi parameters and had another look at the remaining file system space:

 ----------------------------  
 about.htm    : 511 bytes  
 ap-mode.lua   : 89 bytes  
 counter.txt   : 1 bytes  
 dns-liar.lua  : 1352 bytes  
 index.htm    : 459 bytes  
 init.lua    : 46 bytes  
 instruct.htm  : 1075 bytes  
 kg-small.png  : 6037 bytes  
 server.lua   : 3144 bytes  
 ttt.htm     : 19471 bytes  
 wumpus.htm   : 13825 bytes  
 ----------------------------  
 Total file(s)  : 11  
 Total size   : 46010 bytes  
 Total : 1513781 bytes  
 Used : 50702 bytes  
 Remain: 1463079 bytes  

Still plenty of space remaining. I then restarted the module and:

Beauty! No trouble at all. (see edit below)

Edit: I might have a minor problem writing the counter.txt file to the local file system. The games loaded unreliably, so I commented out the code for the counter and the system was sometimes back to the expected speed. I couldn't find a change in the nodeMCU firmware to account for that. - This needs a closer look.

Two OLIMEX MOD-WIFI-ESP8266-DEV boards in the mail

When a CaptiveIntraweb experimenter from Chicago pointed out that he had problems with Olimex ESP8266 modules, we looked into the problem and it seemed like a file system related issue.
The cool thing is that these modules come with 2MByte of i2c flash, rather than the usual 512k. And that might just be the source of the problem.

I wasn't aware these modules existed and immediately ordered a pair. Despite the fact that the German postal service is on strike, the modules arrived on Saturday.

Nice silkscreen 

The weekend was rather busy, so I couldn't test drive the modules. From the first look, I am impressed by the build quality and the nicely readable silkscreen. So impressed in fact, that I'll mount the headers upside-down to have an unobstructed view of the print.

One thing I didn't like at first glance was that to change to flash mode, I need to change soldered jumpers. With the number of tries I need to get things right, I considered mounting a switch.
A closer look at the schematic revealed this:
Now that's nice circuit design! I can still use a jumper cable on the breadboard to tie GPIO0 to GND manually to reflash the firmware. 

I will try that tonight and let you know how it went.
It went better than I expected. See here.

Wednesday 17 June 2015

Installed new build environment for ESP8266 firmware

It seems about time to refresh the firmware for my CaptiveIntraweb portal. There are three issues I hope to address:

  • I couldn't get my i2c OLED to work with the February build of NodeMCU. My firmware is based on that.
  • A user from Chicago reported problems with Olimex modules. I ordered a pair of them because they'd make ideal platforms for throwies with their 2MByte (as opposed to 512kByte) i2c flash.
  • It all seems to be open source now, so I can redistribute the firmware freely. Although it looks like a blend of quite a few flavours of open source licenses.

What I have done up to now:

  • Installed the espressif ubuntu image from here
  • Installed the build environment with pfalcon's excellent esp-open-sdk
  • Downloaded NodeMCU sources from the master branch

I have made the following changes to the code:

  • In ./app/include/user_config.h around line 50, comment in #define LUA_NUMBER_INTEGRAL to reduce overall memory requirements
  • Changed line 10 in ./app/include/user_version.h to #define NODE_VERSION    "NodeMCU 0.9.5/AReResearch", so I can see I am on my homebaked version when the module boots up
  • In ./app/include/lwip/app/dhcpserver.h add #define USE_DNS somewhere (around line 54)


I have not changed the Buffer size:

Line 545 in ./app/lua/luaconf.h is currenlty left at:
#define LUAL_BUFFERSIZE         ((BUFSIZ)*4)

This had caused problems with the dns-liar.lua script in the past. If it still does, I will change that.
With regards to the 2MByte Olimex modules, the code defaults to "auto" for the flash size. But I'll have to wait for the modules to arrive to check that out.

Next step: try it on an esp-01 module
That worked ok.
Next step: try it on an Olimex MOD-WIFI-ESP8266-DEV

Edit: 20150622