Posts

Showing posts from May, 2007

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…

Losing the weekend fight

Image
Over the weekend I've lost several battles:
First one was against my TV computer. The Asrock motherboard died last week, so I bought a replacement but it was an Elitegroup VIA KM400-M. To make a long story short I tell you this mobo does not play right with my Nexus-S PCI card. Of course, figuring that out took me a good part of the weekend. I sent a support request to the manufacturer, but given the way the manage their website I'm afraid I am in for a big dissapointment.

Second, I turned to my desktop to scan some pages I realized that my Ubuntu upgrade to Feisty also did bring an annoying bug that made my Acer S2W 3300U scanner not to work properly. It turns out it is a new bug that can be avoided by using the scanbuttond application (weird but true, this daemon-like application prevents the scanner to be powered down which is what causes the bug). Finally I managed to get the work done, but I'm exhausted. Those of you with your shine Vista and the same scanner are not l…

Weird CUPS printing problem

Since I installed Ubuntu's Feisty Fawn my user impressions have been very good. However, some days ago I experience a weird problem when my system began to work erratically. I was not expecting it so it took me some time till I realized my filesystem was full. I did not understand why that was happening as the last time I checked there where more than 7GB of free space on that partition. But the first trouble sign was that print jobs where not printed.

After some confusion I realized I had 7GB /var/log/cups/error_log file. So that was the cause of my trouble. Inside the file I had millions of lines with the error message "Too many open files". It was clear there was a problem with the printing system.

I googled for that and I learned there were not one but two different reports of a similar problem. Just restarting the printing system was restoring the service (but not deleting the error_log file).

As soon as I removed the error_log file and restarted cups I was back on,…

OpenOffice fonts in Feisty

Image
A colleague of mine who tried the new Ubuntu 7.04 was not happy with the OpenOffice Impress tool (I'd say he was not very impressed) because certain pages were rendered using larger fonts that in the original page. This odd behavior was forcing him to patch slides that were ok for previous versions of OpenOffice.

I haven't experienced the problem myself, but I told him to have a look at Launchpad to see if there was a bug report on this and, if not, to file his own bug report. It turned out that a very helpful guy reported a similar problem, its cause and several suggestions to fix it.


It turns out there is nothing wrong with OpenOffice but last version of Ubuntu fails to do the right substitution with some fonts. This bug was not happening on previous Ubuntu versions though. As my friend's problem was due to the use of some TrueType fonts from Microsoft (a document migrated from PowerPoint) I suggested to install the package msttcorefonts and that fixed the problem.

eBay experiences

A few days ago I bought one item from a seller on eBay. Seller looked good. But two days after I sent my payment I got an eBay warning message telling me the seller's account has been canceled and advising me not to send any money. Unfortunately the money was already sent so there was not much I could do.

Checking the seller's account feedback page revealed that the flow of feedback messages had stopped as users cannot leave feedback on a canceled account (not sure this is a good idea) even if buyers are already getting what they paid for (or a brick in a box). Let me elaborate on this: Blocking a seller account should prevent the seller to do "any more harm" (ie. to sell any new item) but the feedback information is useful mostly for buyers, so you are here punishing the buyers if they cannot post feedback for a blocked account.

Some days later my product arrived ok and I was surprised when I can see I can leave feedback for this seller. In fact, it seems the seller i…

New life to the Traveling Salesman Problem

Image
I learned about this problem when I was a CS student: A salesman has to visit a set of cities and then returns home. The problem is to find the fastest/cheapest/shortest way of doing so. It is a NP-hard problem as the solution space is n! (for a n-city problem) that is impossible to be examined fully in a lifetime. It can be entertaining to do by hand, but there are many programs that may help you, like Concorde.
My interest for TSP was sparked as a possible solution to the optimization problem for the drawings made with my home-made painting machine. It is not a new problem but I was not aware of the best solution possible. I was lucky enough contacting Michael Trick who, right off the bat, gave me a nice and elegant solution.
I need to determine the right order for drawing a set of n lines but each line may be drawn in one direction or backwards. The solution to the problem needs to determine the drawing order of the lines plus the drawing direction for each one that makes the total d…

A good moment for a backup

Image
After doing a full backup of my trusty Ubuntu 6.06 system at home I decided to give it a shot to the new Ubuntu 7.04 (aka Feisty Fawn). I just decided not to be on the cutting edge and I did the install only after other users were reporting successful installs. So far I've updated a couple of my systems, the first one, an ASUS pundit worked like a charm and the graphics card was detected ok. The second system, with an ASROCK mobo with an ATI Xpress 200 graphics card was not so lucky and though the install worked I needed to do some black magic to get the graphics working at the right resolution and, more important, to get 3D acceleration.

Why is 3D needed now? Well, it is not really needed but after so many comments about all the "experimental" graphic features nicely included in the last Ubuntu I decided it will be nice to try it out (don't worry I am not posting any video to youtube).

The bottom line is that the new 7.04 feels a better Ubuntu than ever before, with a…