Showing posts from November, 2008

Moving code from ESP8266 to ESP32

A while ago I made a mashup of Dan Royer's code CNC 2 Axis Demo with my own code for trapezoidal motion stepper and servo control for ESP8266.

I assumed porting the code to the ESP32 would be trivial, and that was true for the most part: changes like library name being Wifi.h instead of Wifi8266.h were not a problem. UDP now does not like multicharacter writes but you can use print instead. So far so good.

However, when it came to the interrupt code I was stuck with the stepper interrupt causing an exception sometimes. And to make things weirder, the servo interrupt worked flawlessly (both of them had the IRAM_ATTR directive if you ask me).

Going little by little, I could narrow down the culprit to a floating point operation during the interrupt, that would cause problems sometimes but not always. Browsing around I found this post. Where the solution was simple: do not use floats within the interrupt routines but doubles. The reason was the float calculation would be performed by…

Does Google blur phone numbers on Street View?

I was looking for a business telephone of a tyre repair garage. Unfortunately the small shop might not be paying to get an ad on yellow pages and I could not find it.

Next step was to try to find it on Google Maps Street View, as I knew there were lots of text on the garage walls. Unfortunately, though I could find that street photos, the photos blurred the last group of seven numbers. Though I've searched around, it does not seem to be an error: Apparentely the software does blur not only faces but also license plates. I wonder wheter these numbers on the wall might be considered license plate numbers. At any rate I was lucky enoughthat one of the angles of the scene did not blur the numbers. Hopefully we'll get an appointment to get our punctured tyre repaired soon.

Some power benchmarks

After some time willing to do this I've found a moment to do some measurements. Firstly, I've removed Arduino Mini Pro power led resistor to see how much current was needed for the device in power-down mode: It's just 155uA@3V3, even lower if you go down to just 3Volts. The Mini needed 5mA for normal operation (with no output loaded).

The other component I was interested on testing together was Digi's XBee module. While XBee needs 50mA on operation, using SM=1 (Hibernate mode) the power goes down to 1.6uA when sleep mode is forced (by raising pin 9 to high).

That all means that a basic wireless sensor node based on this components will use at least 55mA during ON periods and 0.16mA while SLEEP. That translates into about 4 hours of continuous operation from a 220mAh 3V button cell.

However, if node is powered up only 3 seconds every 5 minutes, then the same battery should last around 13 days. This seems to start looking ok for my sensor network project.
A recent project required the use of an industrial computer, able to work within a wide range of temperatures. Interaction with other systems would happen by serial and Ethernet ports.

I've used devices manufactured by Moxa, running uClinux (a slim version of Linux that can run in systems without an MMU, like some ARM processors).

Development is done using a GNU C cross-compiler and almost all the time development uses familiar tools.

My systems came from factory with an old version of the kernel I had to upgrade, but once upgraded they are working rock solid. Manufacturer support was also valuable whenever a feature was expected but missing on the uClinux distribution (i.e. no ?time functions on busybox-based find).