dumbasPL / aero2solver

Solve Aero2 captchas automatically using the magic of machine learning and computer vision
MIT License
16 stars 5 forks source link

Qestion: It is possible to port that into microcontrollers? #2

Closed Kuchasz closed 4 months ago

Kuchasz commented 4 months ago

I'm looking for a way to run this software on the smallest possible device. Probably i will start with some SBC like OrangePi but that hardware doesn't have wireless adapter which could let connections to my mobile router.

Do your code use any system or cpu specific APIs? Im curious if it is possible to compile that rust code to esp32 compatible binary and run that on such development board.

dumbasPL commented 4 months ago

This projects uses darknet (https://github.com/AlexeyAB/darknet) to do it's magic. If you can figure out how to run that on your platform of choice then the rest is just making a few http requests on a schedule. This repo is just glue code to do just that, load the weights into darknet and run it, you could easily re-write it in C for embedded systems since trying to use rust might be a pain there.

From the last time I checked darknet can be compiled in a CPU agnostic way (here are all the supported architectures in Alpine Linux https://pkgs.alpinelinux.org/packages?name=aero2solver&branch=edge) but you will run into memory limitations on devices like an esp32. Haven't checked how much is actually needed but I'm almost certain a few megabytes isn't enough. Personally I wouldn't go lower then something like a raspberry pi zero but feel free to experiment.

If you want to avoid additional devices then buy an ARM based MikroTik router with 4g support and run the docker container directly on that ;) (other routers with custom firmware should also work just fine as long as they have enough resources, alpine packages available for all popular architectures, link above)

the4anoni commented 4 months ago

Ktoś próbował to odpalić na routerze z OpenWRT opartym o procesor MIPS?

dumbasPL commented 4 months ago

package pod OpenWRT to w sumie nie głupi pomysł, można by było zrobić i potestować jakie jest minimum jeżeli chodzi o sprzęt

dumbasPL commented 4 months ago

3

the4anoni commented 3 months ago

@dumbasPL jak dużo aero2solver zużywa RAMu? Właśnie przyjechał do mnie MR3420 v2, ale nie wiem czy od razu szykować się na wymianę ramu czy ujdzie to jakoś? Obecnie jest 4 MB ROMu, 32MB RAMu, wgrane LEDE 17, w TODO SPI wrzucę 8MB + zrobię extroota i custom build OpenWRT 22 albo 23.

dumbasPL commented 3 months ago

@dumbasPL jak dużo aero2solver zużywa RAMu?

Statystyki dla OpenWRT x86_64, innych narazie nie testowałem ale powinno być dosyć podobnie

Package size

Ram usage

Więc na 32MB nie masz co liczyć a na 64 może być ciasno i nie wiem czy momentalnie nie jest potrzebne więcej jak rozwiązuje. Więc jak bym powiedził 128 minimum żeby dobrze działało

PS: English prefered btw