-->
Page 1 of 1

Building PanStamp SWAP modules into NodeMCU

PostPosted: Mon Mar 28, 2016 4:28 am
by boraozgen
Hey all,

I am currently working on an IoT project and I want to implement a low power RF protocol using TI CC1101 RF transceivers. My nodes will be battery powered devices and my gateway will be a NodeMCU.

I have managed to communicate with a node via CC1101 (using the NodeMCU's SPI module), however simple transactions are not enough and I think it will take less time to implement an existing protocol rather than creating my own protocol.

PanStamp has a great little protocol called SWAP and it has its Arduino libraries (in C++). I was wondering if it is possible to create my own Lua module by adding some code to this C++ library and then build it using Docker. Is there a documentation about creating new Lua modules? Has anybody done something like this and recommend a place to get started?

Regards,
Bora

Re: Building PanStamp SWAP modules into NodeMCU

PostPosted: Tue Mar 29, 2016 8:07 pm
by TerryE
My out of date FAQ before has some useful links on Lua, etc . Debugging C on the ESP is a bitch. So it's worth trying to build a simple extension on a standard Lua build first as gdb works here and this makes life a lot easier. Any complex algo stuff and I first develop as much as I can on my Linux laptop before potting to nodeMCU. Also look at some of the modules in the firmware's app/modules dir.

If you are going battery power then you are also going to have to read up on deep sleep mode.

Re: Building PanStamp SWAP modules into NodeMCU

PostPosted: Tue Apr 05, 2016 8:07 am
by boraozgen
Thanks Terry, I've checked the FAQ and I am currently trying to register some modules to the firmware. Since the library I want to implement is in C++, I am trying to add a simple cpp file. I've made some changes in the main makefile so that it compiles .cpp files and it built with no errors, however when I add

Code: Select all#define LUA_USE_MODULES_TEST


to the user_modules.h header, esptool.py gives this error:

Code: Select all../tools/esptool.py elf2image .output/eagle/debug/image/eagle.app.v6.out -o ../bin/
Traceback (most recent call last):
  File "../tools/esptool.py", line 612, in <module>
    image.add_segment(e.get_symbol_addr(start), data)
  File "../tools/esptool.py", line 363, in get_symbol_addr
    self._fetch_symbols()
  File "../tools/esptool.py", line 360, in _fetch_symbols
    self.symbols[fields[2]] = int(fields[0], 16)
ValueError: invalid literal for int() with base 16: 'U'


I wonder if anybody else tried adding C++ files to the firmware?