Category Archives: Howtos

How to set up Arduino IDE for esp8266 programming

The Arduino (or in some cases also Genuino) is a physical hard and software development plattform. During the recent years its developing environment grow to a useful and library rich developing platform. Because of that the esp8266 team created an conversion tool to its internal programming language lua.

Setting up the Arduino IDE for esp8266 programming is really easy. Just follow this small guide.

Step 1: Download the arduino IDE software

Go to the most recent version download page of the Arduino IDE. Please keep in mind that you’ll need at least version 1.6.x. In some cases it is not available at the packet repositories of your beloved Debian Distribution.

screenshot-from-2016-12-28-15-22-44Click on Windows, Linux or Mac Version of your choice. We are going to use the Linux 64bit for further pictures.

screenshot-from-2016-12-28-15-24-53Extract the provided tar.gz. For windows or Mac please use a extraction software like 7zip, Winrar etc accordingly.

screenshot-from-2016-12-28-15-28-32Please make sure the arduino.sh file in your directory is excecutable.

screenshot-from-2016-12-28-15-28-49

screenshot-from-2016-12-28-15-29-01You also can use the terminal command:

After that double click the application…

screenshot-from-2016-12-28-15-33-03or use the terminal to start the IDE. This is also very useful to see possible errors after they occure while flashing the esp8266 from time to time.

 

screenshot-from-2016-12-28-15-33-21

Et voila, your IDE should look somehow like this:

screenshot-from-2016-12-28-15-34-45

Step 2: Setting up the IDE to work with ESP8266 by board manager.

We need to add an additional url to the boards manager sources list. For that open File > Preferences

screenshot-from-2016-12-28-15-37-55

And add http://arduino.esp8266.com/stable/package_esp8266com_index.json  to the Additional Boards Manager URLs.

screenshot-from-2016-12-28-15-38-25After that open Tools > Boards > Boards Manager and search for esp8266.

screenshot-from-2016-12-28-15-39-28

install the latest version:

screenshot-from-2016-12-28-15-40-02

After that you should be able to select the Generic ESP Module board in Tools > Board

screenshot-from-2016-12-28-15-41-22

screenshot-from-2016-12-28-15-42-15Congratulations! You are now able to compile esp8266 code from the arduino IDE.

Step 3: Use the Examples to learn to code

This step is easy. Open File > Examples > ESP8266Wifi > WifiWebServer as a good starting point.

screenshot-from-2016-12-28-18-12-55

In the next post we will have a look at how to wire the ESP8266 up for an easy flashing.

Controlling ws2812b with an esp8266 by open-pixel-control protocol

Harder than it looks but controlling an 5m led stripe using the esp8266 by the open pixel control protocol took me a night (and might be the reason for extra bad english as i write this post directly after it). But it’s real fun!

There are several ways to make the controller blink, the easiest way is shown here:

For the duration of infintiy, it sends the static header consisting of 4 bytes ( prio, command and checksum) followed by 8bit red 8bit green and 8bit blue for each led of the stripe. It gets the blinking values by asking the source of random in linux.  It lacks a bit of white as my power source got to its limits, so if you reimplement this use 5V and 1A per 30 leds.

Another thing to mention is the data length field which are bytes 3-4 of the header or \x02\xA6 as in the command above. This length needs to equal the amount of leds times three, so in this example 226 Leds where controlled as the bytes in network order end up to be 678.

This results in that little animation:

Another possibility is to send these packets by a small python script like that:

Code for the controller at github.

Arduino microphone sensor analog + digital

I tried a small arduino microphone recently:

Output looks like that:

 

Well explaination how sound sensors work:

Synchronize the time in ROS offline environments without chrony

As our [amazon &title=CubieTruck&text=CubieTruck] is faced with strange issues when using chrony and internet access is not a general prerequisite on ROS setups, i needed to figure out a new way to synchronize the time with no internet ntp server available. For some reasons, even my local ntp was broken, which is why I try to set the time according to the ros master on all clients by this simple bash command:

it simply extracts the IPv4 part of the $ROS_MASTER_URI environment and uses ntpdate to set the time on the excecuting client system.

In case you only want to know the exact time derivation consider using the ntpdate parameter -q which only emulates the request.

LaTeX borders around hyperref links and references

As I am currently writing my thesis and stumbled around the problem of borders around any reference (or link) inside the generated .pdf document, I first came around with an solution like that:

Which worked by setting all borders of hyperref to the color of white and therefore on a white document to an invisible color.

But later on, especially when programmatically writing tree graphs with background colors, this solution didn’t work anymore.

Which is why I needed to change the way of usage to:

instead of the previous block. Now there is no disturbing border anymore and teXing got a little better 🙂

 

asd