Posts

Showing posts from October, 2008

Moving code from ESP8266 to ESP32

Image
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…

Enterprise WPA troubles

Image
Two gadgets we've got recently refused to access the university wireless network. The reason is that WPA with an EPA-PEAP autentication server is used on UPV campus. The ASUS eeePC that comes with Xandros Linux does not support that. Alternatively I could use the eeePC built-in VPN to connect to a secondary wireless network, but again, that software did not work either.

The Nokia E71 cellphone does support WPA Enterprise, but contrary to other wifi setup that can be done on the fly, the so called WPA Enterprise is hidden down there in the system configuration menus.

The solution I took for the eeePC was quite radical as I installed eeeXubuntu. There is a special Xubuntu version that worked for me. You create a boot image on a USB flash dish to get it installed on the eeePC. One word of warning though: I you accept to install system updates, each new kernel update will break the Atheros wireless driver (it can be rebuilt later, but it's a manual process).

The solution for E71 was …

Low power arduino

Image
I've bought recently a new Arduino Pro Mini. I was mostly interested on what the minimum power consumption might be when powering it at 3.3 volts. The average current was 5 mA with pin 13 led off. But what it is most interesting is that sleep mode current goes down to 400 microamps (and this is still keeping the red led on). As the red led resistor is 10k I guess the sleep current will go to almost nothing once I remove the red led resistor. That is a very interesting value if you're worried about power consumption for sensor network applications. A CR2032 will last for more than 500 hours at 0.4 mA!

Stippling fun

Image
Have you ever wondered how to achieve a monochome representation of an image using just dots? This is what stippling is all about.
The next question is how this can be done. You might have seen Wall Street Journal hedcuts and they look great, but they are produced by a human artist.
Machine-based approaches like dithering and half-toning work well too, but they are not quite the same as the above.
Google led me to the nice work of Adrian Secord, with the not so suggestive name of Weighted Voronoi Stippling.
Author provided binaries and source code too. Unfortunately it did not work for me. But after contacting the author, who provided me an updated binary that ran on my Leopard iMac. You have a sample image of the input (right) and output (left).
I want to thank Adrian for being so kind of including my suggestion of adding SVG output to his code (and for making his project's code available).

Fixing Hardy audio problem with Pulseaudio

One of the few problems I've got with Hardy (Ubuntu 8.04) has been a weird audio problem. It looks like Flash plugin and any other application that plays audio do not like each other. So I have had to close Firefox completely to get audio working again in, let's say Rythmbox.

My audio device is Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02)

I research the problem a bit and I've found three pieces of advice:

1) Install libflashsupport (which did not fix my problem)
2) Restart pulseaudio (that might be done right by killall -9 pulseaudio) or kill gnome-power-manager
3) As suggested here: asoundconf set-pulseaudio (this one worked for me)

Now I can play a song on Rythmbox while viewing (and listening) a video on youtube. Something it was possible on previous versions.

Inkjet vs Laser

Image
Have you ever been interested on the output quality of both Inkjet and Laser printers? I can see many comments on the net about the cost of running the two types of printers. Someone mentioned that HP is making $10 billion dollars a year selling inkjet cartridges (this seems like a lot of money).

I am not worried about the printers' running cost at the moment. A recent project required me to study a few pages of a document. On a closer inspection I realized they were not printed on the same printer. While laser printed documents create well-defined contours, inkjet printers seem to create small ink spikes on line contour (as you can see on this entry photo).

Light reflection properties are also different, inkjet black being non-reflective but laser printed black being slighty reflective.

I'm not complaining about any type of printers as for regular use I think both provide good-enough output. However, it seems it is not difficult to tell which printer you are using just looking c…

Trouble with ASUS hardware

Image
While my refurbished-at-home Apple iBook is happily running I put myself in the trouble waters of replacing my aging computer. But first things first: a few months ago I bought my wife an ASUS EeePC subnotebook. While it worked out of the box we quickly realized something was not quite right with it, as any minor impact (as hitting the surface with your fingernails) could trigger either a reboot or completely hang the system. After an RMA, the replacement unit seems to be working happily (after I figured out how to get WPA working first; BTW, do the system upgrade over Ethernet connection BEFORE trying to log onto a WPA wifi network whose passphase contains spaces!!).

For my new desktop (replacing an old Pundit-R) I chose a mini tower barebone PC again from ASUS with a new E8200 Core 2 Duo processor. The system works nicely most of the time, however there is trouble: The Marvell Gigabit Ethernet adapter on the motherboard still has some issues with GNU/Linux kernel. Even the Intrepid I…

Google's App Engine

Image
We've got a talk at our university about App Engine by Googler Mano Marks. In short App Engine is Google's alternative to LAMP. And, like Gmail, Google is offering you free hosting for your web-based application (up to certain storage and daily bandwith limits).

Application logic is written in Python, although other languages might be supported in the future. And backend storage is based on BigTable, which does not follow the classic relational model of many *SQL databases. For me these are two changes that may turn some developers down, but the strong point I think is that developers can forget about scalability or availability problems.

While I've created an account and I've downloaded the SDK, I'm only studying the demos at the moment. If you are interested on learning more I think you'll find the video from Developer Day interesting.