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.


26 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. hi.after flash your modified version nodemcu cant read esp on serial port or luatool.I flash with this string esptool.py -p /dev/cu.usbserial-A50285BI -b 115200 write_flash 0x00000 0x00000.bin 0x01000 0x10000.bin 0x7c000 esp_init_data_default.bin 0x7e000 blank.bin

    ReplyDelete
    Replies
    1. Your offsets and files look ok. I always use the windows tool, but that should not make a difference.
      I'll check my firmware build again and get back to you.

      Delete
    2. Hi Melanrz1,
      yes, it looks like there is a problem. I will see if I can fix it. Otherwise I will make an older version available to you that has been shown to run on the ESP-01.

      Delete
    3. Still can't replicate the problem. You are not the only one affected. Please try the Windows-Flasher contained in here if you have a windows machine available: https://drive.google.com/folderview?id=0B5aLgfgZoP1nWHlyVHhhdDI2R2s&usp=sharing

      Delete
  3. Great soft !

    1) You can accelerate A LOT dns.liar with the following code
    svr=net.createServer(net.UDP,10)
    svr:on("receive",function(svr,pl)
    svr:send(string.sub(pl,1,2).."\129\128\000\001\000\001\000\000\000\000"..string.sub(pl,13,string.find(pl,"\000",13)).."\000\001\000\001\192\012\000\001\000\001\000\000\003\009\000\004\192\168\004\001")
    end)
    svr:listen(53)

    Also found a few optimization in server.lua I can share If you want

    2) I'm not sure I understand the file sending routine. Is there a simpler way to do it ?

    3) What would be great (but I'm not able to do this) would be a "lighter" firmware like this one : http://frightanic.com/nodemcu-custom-build/ but with still the dns functionality. This would let more room for files & software.

    I'll try to stick this into a usb key to make a "stealth" version of the intraweb - great way to publish "wifi pictures" anywhere...

    Again, congrats for this.

    ReplyDelete
    Replies
    1. 1) Cool. I'll look into it as soon as possible. You're very welcome to contribute to the project.
      2) The send routine tries to work around two problems: The "event driven" nature of NodeMCU and the fact that the send buffer is small. There is no way to find out how far the buffer has been filled. So I send small chunks. An other way to do that is the yield mechanism used here: https://github.com/marcoskirsch/nodemcu-httpserver - That didn't work properly for me.
      My server still has issues, probably due to my "procedural programming" mindset. So any help is greatly appreciated.
      3) I can try leaving stuff out of the build. Good idea. It is integer-only already, but there is much unnecessary code in there for the CaptiveIntraweb.

      Delete
  4. New improvements:
    a) For the battery : using this (include charging plus & box) http://fr.aliexpress.com/item/Fashion-Portable-ultrathin-White-USB-DIY-Power-Bank-2X-18650-Battery-Charger-Case-Kit-Box-For/32386400464.html
    b) a few software improvements i'll share later, including using this nice tool to reduce heap needs : https://mothereff.in/lua-minifier
    c) still very interested by a "leaner" distribution of the dns-ready firmware if you have some time !

    ReplyDelete
    Replies
    1. I built a stripped down version of the firmware:
      https://www.dropbox.com/s/yvvxje8aum7g4ob/reduced.bin?dl=0
      I couldn't even try it yet. You're welcome to test it. It has all the (supposedly) unnecessary modules removed.

      Delete
  5. Hi ! I'll check it asap, not in Europe now. Is it the .96 fimware (they corrected a gew networking bugs and added functionalities like defining your Mac adress)?
    Btw I think I found the solution to have one year autonomy for 7 $ : http://www.aliexpress.com/snapshot/6843044705.html

    Others tried it successfully - just have to add a photodiode and test at startup to put the esp8266 into a one hour sleep idlf there is no light).

    With a few like this you can easily setup a mesh network and at least route small text messages.

    ReplyDelete
  6. http://www.aliexpress.com/snapshot/6843044705.html

    ReplyDelete
  7. Hi ! Great work, the new firmware works very well. It is the latest version, which also offers the possibility to define the mac address of your esp. It also offers the possibility to chose the wifi mode (and balance between consumption & range).

    You can also greatly accelerate the server by setting the speed to 160 MHZ using node.setcpufreq(node.CPU160MHZ)

    Still waiting for my aliexpress solar battery. I'll try to use the following function to shut off the nodemcu when battery is low http://www.nodemcu.com/docs/node-module/#node-module-node-readvdd33


    ReplyDelete
  8. DAMN ! I tested the server with a blackberry and an iphone, and it does not work : the blackberry is not able to "see" the network, and cant connect to it even using the SSID, and the iphone cant connect either. For the iphone, it is the wifi connection that cant be opened - even before running any lua code...

    It might be the .96 firmware, or maybe you used a not very stable version ?

    ReplyDelete
    Replies
    1. I'll double check as soon as I can. I think I ran the captive Intraweb on that firmware,but I'll have another go to be on the safe side.

      Delete
    2. It worked when connecting the AP with an Android or a PC, not with an Iphone or a blackberry. And the difficulty to connect happened before any lua file was executed - apparently something inside the firmware is involved.

      Delete
    3. Just ran some tests with the reduced firmware. I had no problems with my iPhone. I have no other client devices available at the moment.

      Delete
    4. Oh, there is a flaw: It only appears to accept a connection once. No reconnect possible. I think I have built that from a fairly new NodeMCU release, I'll check for fixes.

      Delete
  9. NB : I just used the former firmware and everything works correctly - even if there is much less memory available, unfortunately...

    ReplyDelete
    Replies
    1. I upgraded my build environment to the latest Espressif-SDK (1.3.0) and used the latest 0.9.6 NodeMCU version. Absolutely no improvement on the WiFi SoftAP connectivity issue.

      Delete
  10. Strange...And funny nobody noticed this - unless thr issue is related with the absence of a key function. Did you try compiling a 'normal' version (ie, integer only)? If this version has the same bug, basically the only properly working version is the oldest one. Can you by chance compile a minimal version of this one maybe ?

    ReplyDelete
  11. Hi Andreas !
    How are you ? I think i have here a very neat version of your throwie : http://iotests.blogspot.fr/2015/10/wifi-throwie-improved-version-faster.html

    Can you recompile the nodemcu lua in the 0.95 version (seems the last stable one) in integer ? Best regard.

    ReplyDelete
    Replies
    1. Wow, seriously cool stuff! I've had the very same LiPo battery pack here on my desk but never got round to try it out. As for the firmware. Try this one: https://www.dropbox.com/s/fyblkervtz02q97/NodeMCU095-ARe-redu-fw-dns.bin?dl=0
      It is a reduced build og 0.95. It has IP forwarding enabled but that should not do any harm. - Keep up the good work!

      Delete
    2. Thanks ! Just tested the battery life : I can keep the ESP8266 alive 2h30 and con¨nect 160 times to the internet (sending a tweet each time). Good enough for many applications... All this for 2.2 $ !

      Delete
  12. Hello!
    Nice work!
    I just started playing with sd card webserver througt arduino ide and it works great!

    Would it be possible to make captive intraweb read the index and the rest of the files from sd card? I am not so good at programming so i someone would help i would appretiate it!

    ReplyDelete
    Replies
    1. I can't see an easy way to do that. I am not aware of a "ready to go" SD-´card solution, although it has been tried before: http://www.esp8266.com/viewtopic.php?f=34&t=2496
      If you find a way, please let me know. In the meantime you can achieve a lot with the 4MByte of an ESP-12e module.

      Delete
    2. Yes. You'll probably be limited by the battery or the bandwidth before needing more memory I think...

      Delete