Live data from Hacker News

Reverse engineering my e-scooter and rewriting the firmware in Rust

bensimms.moe

51–60 of 113 posts

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#51

First of all, this is impressive. I do not know how what the legal context is in your country, but you may need to have a device that uses public roads licensed to do so. In case of any legal issues (accidents, mostly) not only you would not be covered by your insurance, but your situation may worsen for having operated it. Something to keep in mind.

Maybe, but in the case of a crash, would anyone go Ghidra-ing inside your scooter's MCU to check if you replaced the firmware?

It sounds like as long as you don't say anything, no one will ever know.

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#52
post #5

Earlier quoted context omitted.

You only notice the ones that aren't safe. How would you know if someone bypassed the restrictions if they were riding it safely?

Because if they are riding it safely, there would be no need to bypass the restrictions. There is reason for speed limits, they are not there to f--k with people for fun.

You can remove the speed limit of a vehicle for when you want to have fun on a closed course. You don't have to always go over the factory limit.

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#53

> To my surprise, two of the USB-C pins were being used as a CAN bus (which smells horribly noncompliant). Oh god that's awful. Why would anyone in their right mind do this?

Cost. It's a clever hardware hack that saves money, and 1 cent saved over 100 million units is $1,000,000!

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#54

> To my surprise, two of the USB-C pins were being used as a CAN bus (which smells horribly noncompliant). Oh god that's awful. Why would anyone in their right mind do this?

USB-C actually has pins dedicated to application/debug use (SBU1 and SBU2). "SBU1 and SBU2: these are low-speed lines used only for Alternate Mode and accessory mode. For example, with DisplayPort, AUX+ and AUX– transmit over the SBU lines. For audio adapter accessory mode, these lines are used for the microphone input and analog GND."

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#55
Reverse engineering like this is black magic to me. The writeup is good. It's detailed and I could follow along with what the author was doing even though I'm too stupid to ever attempt something like this. Nice job author.

I liked bullet 2 in the Introduction.

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#56
post #14
post #8

Earlier quoted context omitted.

Maybe I'm out of touch with the times, but I wouldn't feel safe riding an e-scooter with custom vibe coded firmware.

What make you think it is vibe coded? There is no mention of genAI being used, and the methodology looks more consistent with hand-written code he actually understands.

I was replying to j_m_b's comment, not the article. But you're right, the article doesn't sound like they vibe coded it.

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#57
post #6

Earlier quoted context omitted.

That's what is nice about LLMs. You CAN do these things now!

No, you can’t. Just because you can pull the lever on an LLM enough times and get something that works doesn’t mean you’ve done the work. Doing the work implies learning and transferable skills, none of which you get by prompting an LLM.

Yes they can. At the end of the day, whether the food was made in a microwave oven or by a Michelin starred chef, the user is fed. Doing the work means that the work happened. Anything else is secondary.

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#58
post #34

We need to free up Bosch systems. They use lots of open source libs, but they close the whole chain (like spare batteries) so that you cannot plug external batteries from other suppliers.

Having been on the flip side of this divide in the past, there really are a lot of potential safety and reliability problems when using random third party versions of components. While I'm sure there are strong financial incentives to constrain supply, there are also some other strong reasons as well. Also it's very expensive to actually make an ecosystem compared to a close one. The best way to incentivize manufactu…

> there really are a lot of potential safety and reliability problems when using random third party versions of components.

What are you talking about?

If a seller sells you random junk that causes safety issue, they are liable of the damage like the OEM would if their product was bad.

Then, if the seller is in a jurisdiction where you can't hope to sue, then it's either your problem for picking this random seller on their website, or we should make it Amazon's problem to feature this kind of sellers in the first place. Surely the biggest retailer on the planet could afford vetting businesses selling on its platform to protect consumers' safety.

In any case, the fact that Bosch's ecosystem is closed offers no additional protection whatsoever, as shady sellers already sell counterfeit components (that may or may not work at all).

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#59

Earlier quoted context omitted.

No, you can’t. Just because you can pull the lever on an LLM enough times and get something that works doesn’t mean you’ve done the work. Doing the work implies learning and transferable skills, none of which you get by prompting an LLM.

Yes they can. At the end of the day, whether the food was made in a microwave oven or by a Michelin starred chef, the user is fed. Doing the work means that the work happened. Anything else is secondary.

A large part of this project was my personal learning. Ultimately I didn't improve the functionality of the device by a large margin; instead I learned a lot about how these devices are built. If I'd let Claude write replacent firmware it would've all been for naught.

Re: Reverse engineering my e-scooter and rewriting the firmware in Rust

#60
post #58

Earlier quoted context omitted.

Having been on the flip side of this divide in the past, there really are a lot of potential safety and reliability problems when using random third party versions of components. While I'm sure there are strong financial incentives to constrain supply, there are also some other strong reasons as well. Also it's very expensive to actually make an ecosystem compared to a close one. The best way to incentivize manufactu…

> there really are a lot of potential safety and reliability problems when using random third party versions of components. What are you talking about? If a seller sells you random junk that causes safety issue, they are liable of the damage like the OEM would if their product was bad. Then, if the seller is in a jurisdiction where you can't hope to sue, then it's either your problem for picking this random seller on…

> What are you talking about?

> If a seller sells you random junk that causes safety issue, they are liable of the damage like the OEM would if their product was bad.

No, the GP comment is right. I’ve worked on products where a lot of users did mods and used third party accessories.

Customers don’t care who, how, or why their product broke. They want to make noise and try to get a warranty fix for it. Customers would try to mod their devices, break it in the process, and then spend weeks trying to drag us on social media until we relented and shipped them a new one for free.

They’re not going to be pursuing damages against the Aliexpress vendor who sold them a flawed battery pack, nor the Amazon seller called WOBALUBAFY that has already disappeared, nor the YouTuber who hastily showed them how to solder some things together.

They always try to hide the evidence and claim the product failed by itself because the big American company has the deep pockets and the ability to send them free stuff to avoid bad PR.

Post reply on HN