Home About Me

Small Rituals, Big News, and One Stubborn Remote-Control App

The baby

I’ll start with the baby. She’s been so good.

cute emoji

This ultrasound looks like the baby is chewing on a hand—haha—maybe not.

baby ultrasound

A birthday, a new mouse, and a few small wins

My wife asked what I wanted as a gift. I kept saying not to buy anything—I don’t really need anything, and she’d already given me a one-of-a-kind gift. I just want the baby to be healthy.

She still gave me a mouse yesterday. The one I’d bought before was probably too cheap; it felt stiff and was hard to press. She said she wanted to get me a better one.

My grandma recently came to Xi’an, and yesterday was a birthday. My aunt came over after work too, and then we went to the mall for dinner. On the way, we passed the lottery stand where I often buy scratch cards, so I picked up three 10-yuan ones just for fun. My aunt’s ticket won 20, which meant we were down 10 yuan overall.

My meal was free—most restaurants here will waive the bill for the birthday person that day, or at least give a big discount. The shops in Xi’an are actually pretty reasonable about it; usually it’s free for the person whose birthday it is, and that’s it.

birthday meal

Meituan also sent a birthday message and a free drink. It’s basically only free if you order coffee, and I almost never drink coffee—haha—so I’ll probably end up getting a lemonade. I haven’t used it yet, so it’s just sitting there for now.

Meituan birthday drink

Yesterday afternoon, while my wife was at work, she said she wanted Japanese persimmons—that’s what we call the crisp kind here. I bought some. A little later she said her office didn’t have a fruit knife. I contacted the shop owner, who said he could peel them for us. I’d asked whether I could buy a knife, but he said they couldn’t sell knives; peeling them was no problem. Very thoughtful. Most shop owners would probably do the same.

persimmons

peeled persimmons

A remote device control detour

A couple of afternoons ago, my colleague asked me whether I could build a certain feature for a device. After looking at it, I figured a TCP connection would be the easiest route; IP address + port should be simple enough to handle. The other requirement was documentation for the data packets.

The device already had control software, but the annual license wasn’t cheap, had to be renewed every year, and there wasn’t much technical content to it. I said I’d give it a try.

I like tinkering, so when something like this comes up I want to try it. Whether I can actually pull it off is another matter. This morning I got it working. This version is modified from my colleague’s version.

device control

We spent a couple of days figuring out how to use the thing, what packets to send, and so on. Once the whole flow was clear, the coding was the easy part. Java or Python both work; you just need the driver package.

working version

Yesterday my colleague tried building it in Python. I explained the flow, and he wanted to try it himself first. He went through three versions, and there are still a fair number of issues.

Python version

A few problems stood out in the code:

  1. Refresh issue: in yesterday afternoon’s third version, the refresh button worked, but it affected operations that had already been done. For example, if you’d opened channels 1–4 and then hit refresh, the program logic would error out and change some button states, even though the device itself hadn’t changed. That looks like a logic mistake in the AI-generated code.
  2. Record function: every time the software opens, you have to start over. In real use, the device will definitely have a series of operations done to it. Every time you open the software you have to reconnect, and after you connect remotely you have no way of knowing whether the device channels are still closed or already open.

That’s where things stand for now.