Random Musings on Technology

Roomba 650 Schedule Programming


Steps to Program Roomba 600/650 with UART cable

I needed to put this something in case my computer crashes. These are instructions to setup the schedule of a Roomba 600 or 650 using a USB to UART cable.

[I will upload the Roomba Status Program later... it is getting difficult to find it on the internet).

  1. Control Panel / Devices and Printers, look for FT232 USB UART. Check COM port
  2. Open Roomba Status program (installed in windows or to install in Downloads)
  3. In R.Status settings, select COM corresponding com port and 115200 baud rate (leave other settings as they are)
  4. Set Roomba in programmed mode. Send:
    7 128
  5. Lets ensure we are doing things right by programming and playing a song
    5.1 Record the Song in the roomba, send: 140, 2, 7, 60, 32, 38, 32, 40, 32, 36, 32, 40, 32, 36, 32, 40, 32 5.2 Go into Full Mode by pressing the Start button of the Movement panel 5.3 Play song. Send:
    141, 2 At this point the song must be played... try changing values for the notes to ensure that you are actually playing this 5.4. Go back to passive-move by clicking Stop

  6. Set Roomba Time (chage 21:07 to adequate values and 3 for weekday 0 - sunday 6 saturday):
    168, 0, 12, 01

  7. Set Roomba Schedule (167, 127 are the instruction code, then hh,mm for each day of the week ):
    167, 127, 06, 30, 06, 30, 06, 30, 06, 30, 06, 30, 06, 30, 06, 30 8 You are Done!. CLick on Disconnect and then Exit.

Serverless: Google Cloud vs AWS


Just spent 2 hours trying to make some basic Google Cloud Services examples of Serverless to work, directly from the Serverless page to no avail. GCS was returning all kind of weird errors, including HTTP 500 ...

After that decided to move to use the AWS examples, and the first one I tried worked like a charm! Google has a long way to go to be at the level of AWS, right now the infrastructure seems crappy, if you cannot even run the most simple examples of a simple HTTP serverless function.

TypeScript: Millennials discover Static Typing


I was reading the book Programming Typescript. Making your Javascript Application Scale when I found this gem:

“So here’s a question: when exactly does JavaScript tell you that you made a mistake?

Right: when you actually run your program. Your program might get run when you test it in a browser, or when a user visits your website, or when you run a unit test. If you’re disciplined and write plenty of unit tests and end-to-end tests, smoke test your code before pushing it, and test it internally for a while before shipping it to users, you will hopefully find out about your error before your users do. But what if you don’t?

That’s where TypeScript comes in. Even cooler than the fact that TypeScript gives you helpful error messages is when it gives them to you: TypeScript gives you error messages in your text editor, as you type. That means you don’t have to rely on unit tests or smoke tests or coworkers to catch these sorts of issues: TypeScript will catch them for you and warn you about them as you write your program.”

Funny how the old becomes new... static typing has been available for ages, but apparently JavaScript is now "old" and statically typed JavaScript is in vogue now.

On Pointers and Software Developer Candidates


Recently read a good article by Joel Spolsky. The Guerrilla Guide to Interviewing v3.

This paragraph brought me some chuckles first, and later some sadness:

I’ve come to realize that understanding pointers in C is not a skill, it’s an aptitude. In first year computer science classes, there are always about 200 kids at the beginning of the semester, all of whom wrote complex adventure games in BASIC for their PCs when they were 4 years old. They are having a good ol’ time learning C or Pascal in college, until one day the professor introduces pointers, and suddenly, they don’t get it. They just don’t understand anything any more. 90% of the class goes off and becomes Political Science majors, then they tell their friends that there weren’t enough good looking members of the appropriate sex in their CompSci classes, that’s why they switched. For some reason most people seem to be born without the part of the brain that understands pointers. Pointers require a complex form of doubly-indirected thinking that some people just can’t do, and it’s pretty crucial to good programming. A lot of the “script jocks” who started programming by copying JavaScript snippets into their web pages and went on to learn Perl never learned about pointers, and they can never quite produce code of the quality you need.

Unfortunately, more and more Software Developer candidates are becoming "copy pasters" and do not have the skills to understand what they are doing, understand what is happening.

A Patch for AoE II HD on Linux


So apparently there is a wine bug that has been open for more than 7 years affecting Age Of Empires II HD. The game keeps scrolling the screen when inside a battle.

Fortunately someone found the specific bytes that can be changed as a workaround for the bug. I am saving the workaround here in case it is lost at some point:

Original link: https://steamcommunity.com/app/221380/discussions/2/622954302095447538/#c154645539343670235


Ive been having this issue under wine as well, and finally got annoyed enough to look into it. I have an explanation and fix which seem to have fixed the issue for me so far.

The game is using the GetKeyboardState() function to read the arrow keys (and other keys), and is not checking the result correctly. The MSDN documentation for the function only defines the low bit (0x01, meaning that the key is "toggled" à la Caps Lock) and the high bit (0x80, meaning that the key is pressed). Age of Empires (both 1 and 2) check if the key is pressed by checking if the result is > 1. This works most of the time, as it does not depend on the low bit. However, the undefined "middle" bits are occasionally used by windows/wine internals, and are not guaranteed to be zero. The game should check only the high bit (by ANDing it with 0x80).

I've patched version 5.0 to do this for the arrow keys (replace 80 3C 01 01 at offset 0x4525D4 with 80 24 01 80 and 0F 97 C0 at 0x4525DB with 0F 95 C0 in AoK HD.exe). Note that this doesn't fix the issue across the board — the Tech Tree screen also uses GetKeyboardState() and checks the result in the same way. It'll also need redoing for each version until it's fixed properly by the developers.

I only had to do the first replacement for it to work :); this using any hex editor (like Bless). Afterwards, I can enjoy AoE II HD on Linux.