Top
Best
New

Posted by vinhnx 4 days ago

Reverse engineering my e-scooter and rewriting the firmware in Rust(bensimms.moe)
400 points | 92 commentspage 2
1saadcodes 5 hours ago|
This is genuinely very cool. Amazing work and article
ifh-hn 16 hours ago||
Wish I was brainy enough to do this sort of thing!
j_m_b 15 hours ago|
That's what is nice about LLMs. You CAN do these things now!
binary0010 12 hours ago|||
I'd be pretty careful with this kind of thing. My friend vibe coded something similar and it had some very unexpected real world bugs like instantly locking the engine, cranking the engine to 100 in a second and burning the motor out, etc. So something like an escooter that you might ride across a busy road may not be the best use of vibe coding.
rfgplk 12 hours ago||
You can use an LLM but you have the provide the spec of the motor and the surrounding hardware apparatus. Not every motor is the same.
wkjagt 14 hours ago||||
Maybe I'm out of touch with the times, but I wouldn't feel safe riding an e-scooter with custom vibe coded firmware.
GuB-42 14 hours ago|||
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.
wkjagt 10 hours ago|||
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.
exe34 13 hours ago|||
What makes you think the original wasn't vibe coded?!
thenthenthen 13 hours ago||
The firmware on these things is terrible, also larger e-mopeds btw. Like a 2 second delay on the throttle after breaking (fun when cornering!). Happy this Egret GT E-Scooter didnt turn into..’Regret’
IshKebab 14 hours ago||||
You don't have to fully vibe code it. Most of this stuff doesn't take massive brains, it is just super tedious - especially the reverse engineering. I've never really had the patience for that (except one USB devices that I did reverse engineer when I was younger). AI really helps with the tedium.
m00dy 14 hours ago|||
If it is coded in safe Rust, why not ?
malnourish 14 hours ago||
Safe rust does not mean correct logic; best not conflate the two.

You could have perfectly safe rust that disables brakes above a certain speed, inverts steering by wire, or adjusts the charging parameters, for example (depending on addressable capabilities).

m00dy 12 hours ago|||
I meant something deeper.
gohomeloser 14 hours ago|||
[dead]
nearlyepic 11 hours ago||||
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.
fragmede 10 hours ago||
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.
nitros 10 hours ago|||
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.
devsda 10 hours ago||||
A microwave just cooks your input ingredients and if you use non microwave safe containers or food that is not suitable for it, you get edible but hazardous food.

Garbage in, Garbage out. There are minimum expectations on user like ability to source proper materials, use them correctly and an ability to verify/check the result for problems. More important if it's something you want to eat or ride!

nearlyepic 10 hours ago|||
You wouldn't call someone who puts food in a microwave a chef, would you? And you wouldn't say that putting food in the microwave is the same thing as cooking a Michelin star meal. These are different things.
perching_aix 7 hours ago||
How they meant "you": https://en.wikipedia.org/wiki/Generic_you

How you meant "you": https://en.wikipedia.org/wiki/Deixis#Personal

I have a hunch this is not lost on you though, and you're doing this performatively.

Please stop. It is beyond tiresome, and it is not going to compel anybody. On the contrary, it is a great way to induce animosity.

I assure you that what you're describing is lost on no one either; rather, unlike you, plenty of people simply do not care, and find this distinction trite at best. Especially when presented this way.

nearlyepic 3 hours ago||
> I have a hunch this is not lost on you though, and you're doing this performatively.

Uh, duh? I’m trying to draw a distinction that the person isn’t doing the work, the LLM is.

> On the contrary, it is a great way to induce animosity.

Sorry, what had you under the impression I was trying to make friends? When people who suck show up to your spot, you make them go away by making it clear they’re not welcome.

spaqin 14 hours ago||||
So you're still not brainy enough to do it, but the LLM can.

I mean. Sort of? The LLM won't go into checking random USB-C connections with an oscilloscope - it doesn't have hands, for one.

tough 4 hours ago||
You could give it some robot hands if you felt so much inclined
the__alchemist 14 hours ago|||
FdCAN or Bx?
hommelix 14 hours ago||
> The updater device then sends 64 byte chunks spread over 9 CAN 0x384 frames

Classic CAN uses 8 bytes long frame, so 64 bits. Is it a typo in the post, vor is it using CAN-FD?

bri3d 13 hours ago||
I read this as the chunks are 64 bytes and thus each chunk is split over 9 frames. I haven’t looked yet but it’s probably an ISO-TP esque framing protocol.
nitros 12 hours ago||
Yep, this is the case. Nine frames are transmitted with the first frame containing a sequence number and the first five bytes, followed by seven frames containing just data, and a final frame containing the last three bytes of data, and a two byte CRC.
baby_souffle 13 hours ago|||
Must be. Can 1.x and 2.0 are fixed size frames.
irishcoffee 13 hours ago||
Could be TP.DT, multi packet.

My guess is a typo.

kooi 3 days ago||
Very nice. Be safe out there when tweaking these things.
TheChaplain 16 hours ago|
From what I've seen on the streets, people bypassing the restrictions will not, and there will be injuries.
jstanley 16 hours ago||
You only notice the ones that aren't safe.

How would you know if someone bypassed the restrictions if they were riding it safely?

Gigachad 5 hours ago|||
Scooters just don't have the geometry to ride fast safely, they are incredibly prone to flicking the front wheel out and chucking the rider on the ground. The only way they can be ridden safely is riding relatively slowly.

"Hasn't crashed yet" is different to "safely"

TheChaplain 13 hours ago|||
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.

yonatan8070 11 hours ago|||
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.
fragmede 10 hours ago|||
That implies that speed itself is unsafe. Which it is not. Airplanes go some 500 mph and mostly don't kill people.
cantalopes 5 hours ago||
Rewriting things in rust is like running doom on things
rfgplk 12 hours ago||
My general piece of advice to anyone looking to do this is not to even bother. Just strip the hardware package and replace it with an arduino/bb or an equivalent sbc figure out what the motors are and wire it up yourself. Way faster and less tedious
the__alchemist 12 hours ago|
> arduino/bb or an equivalent sbc

This is perhaps more of a Maker perspective. I think the article author's approach (What you might classify as embedded engineer) is more suitable broadly. These are categorizations without a fine line, but are IME useful for clustering approaches and preferences.

For another example of an adjacent non-obvious clustering, see embedded vs robotics; they don't have as much overlap as you might guess!

Founderarcstone 11 hours ago||
what a great project nice work!
BrandoElFollito 12 hours ago||
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.

nitros 11 hours ago||
This is definitely something to be aware of. Installing this firmware definitely invalidates the StVO (though I can always flash the original firmware back). Personally I am morally sound with replacing the firmware of the display unit as the critical functionality is still handled by the motor controller (for example, the brake lever sensors are wired to the motor controller directly, and the display must report the throttle position constantly to not trigger a shutdown); the display unit would need to contain intentionally malicious code to cause problems.
yonatan8070 11 hours ago||
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.

arbirk 7 hours ago||
I think you are right, but he did also blog about it..
ivo_repairs 13 hours ago||
[flagged]
barbarkaragul 13 hours ago|
[dead]