Spark max mobile app?

My team has a few sets of neo+spark maxes. We currently use them as prototyping motors because of the easy throttle control in the client app. but pulling out your laptop in order to run a prototype can be annoying. the ability to just go usbc to usbc into the spark max and control the spark via my phone would be extremely useful for prototyping and testing. Also, the app doesn’t even need to be the fully-featured client. For prototyping, all we ever need is the run tab from the desktop client, or even just the throttle slider.

As I throw this idea out on CD, I was wondering both how hard people think this would be to accomplish/implement, and community interest in something like this. And yes, I already submitted a feature request on the Spark Max Trello board.

1 Like

Well, the windows client is just an Electron App.

There’s an old (archived) golang server protocol that makes the USB protocol explicitly clear:

I’ve actually been looking into how this all works, but I’m not experienced with Android/iOS development, so I can’t speak to if this will be easy or not.

I can tell you this though. It will be much easier to get it working on Android because the Spark MAX will show up as a USB device just like any other Linux system on Android. I don’t know that you can put an iPhone in “USB Host mode” though.


We’ve had issues with bad NAND corrupting the firmware on the sparks after a couple weeks of power-off, so I’ve been looking into a way to get the RIO to do a firmware checksum verification and reflash/reconfigure if needed. The RIO just runs Linux, so it would be stupid easy to set up a boot cronjob for this, but it’s the communication with the Sparks that’s not easy.

Well that works for me at least because I have an Android. There are multiple other people on my team who have andriods as well. But yeah, I assumed that it would be easier on Android than ios because of relaxed USB host rules and such.

I think that if you can get the right permissions Apple might be a possibility, but I really have no idea. It’s really going to depend on how they allow the use of the USB port in their API. See, with Android, you can more or less directly access “usb” devices on a phone, given enough permissions.

This is definitely a cool idea. The most difficult part will probably be the USB driver. As of the 1.5.0 release the USB interface has changed, it used to be a serial port, but now it uses a generic CAN to USB driver. So that SPARK-MAX-Server repo will no longer work.

It is the same driver as the ‘candlelight’ version of the CANable, so if you did get the driver to work, it would allow you to interact with the whole CAN bus, and work with other existing CAN to USB devices. Since this is an open source driver there are a few examples you can find, though probably none for mobile, here are a open source links that use the same driver:

Edit: Also note that it would have to be implemented entirely in user space with whatever Android APIs are available, unless this was a custom Android build, since most of the Linux Kernel options for CAN are disabled.

5 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.