[chbot] On the scrounge for an esp8266 board

Geoff sdfgeoff at gmail.com
Wed Jan 9 07:17:21 GMT 2019


Hello,

I was doing a project with both the ESP32 and ESp8266 recently (also from
Linux). With the ESP32, using ESP_IDF worked great, but like you, after
hours of fluffing around with toolchains for the ESP8266, I gave up and
went for the Arduino IDE approach. Note that using the arduino IDE does not
preclude you from using expresiff's SDK directly.In my project I needed
access to some of the low level radio API, so I had to:

extern "C" {
  #include <user_interface.h>
}

You can find all the headers under
~/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/include

The arduino IDE does do some weird stuff, particularly to files ending with
".ino". So if you're hitting strange errors on code you know is valid (of
if you just want to avoid the issue entirely), don't put any code in the
".ino" file. Rather, put all your #includes in the ".ino" (you have to have
all your #includes inside the .ino file for some reason), but have all your
actual code in another, ".cpp", file.

The other option, if you don't need low level access to the API , and don't
care too much about power efficiency too much, is to flash it with
micropython, and then you can:
 1) write all your code in python, which is much easier
 2) don't have to bother with a toolchain at all, because all you do is
upload your files to the board as .py files via UART.
If you take this approach, you can just download a prebuilt image from
https://micropython.org - easy as cake.


Geoff

On Wed, Jan 9, 2019 at 6:35 AM Andy Gardner <ceo at andygardner.com> wrote:

>
>
> On 9/01/19 3:41 PM, Dave Bracken wrote:
> > Andy,
> > Was there a particular reason you ruled out the NodeMCU plugin for the
> Arduino IDE?  If you haven't looked at it, it might get you started more
> quickly.  From what you told me, the Arduino IDE should be able to do most
> of the things you need but I appreciate there's a lot of possible solutions
> out there and if you have a preference for developing on a Linux platform,
> that adds other angles.
>
> Definitely has to be on Linux.
>
>   A quick proof of concept could be to follow the destructions on
> https://www.instructables.com/id/Quick-Start-to-Nodemcu-ESP8266-on-Arduino-IDE/
> as the example code that gets downloaded will get it connected to your wifi
> and a web interface for blinky etc.
>
> Thanks I take a look at that. The final target is a bare bones esp8266
> with a si4703 FM Tuner module, 2 x 18650 LiIon 2 x charge controller and 2
> x 5v solar panel, in a box with whip antenna. Able to be sent to friends
> with zero skills to auto link into their wireless network and then be
> mounted up a pole and left there until something kills it.
>
> Unit will sleep mostly, wake up and check signal levels etc on all FM
> broadcast channels and if something has changed, fire up the wireless link
> and make contact with the mothership via MQTT, then go back to sleep.
>
> I've got the mothership up and running - Mosquitto +
> https://github.com/curzon01/mqtt2sql + Apache ModPERL
>
> > Please feel free to call in if I can be of help writing some code.
>
> That would be great. My brain only has space inside for one programming
> language and that's PERL. I've done some fairly artistic stuff with PERL
> over the years but this C stuff is a little beyond me.
>
> Cheers,
>
> Andy
>
> >
> > Dave
>
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20190109/cdd596b9/attachment.html>


More information about the Chchrobotics mailing list