msDroid - Android application for MegaSquirt

Discussion in 'Throttle bodies & non-OEM ECUs' started by Trev16v, Jun 15, 2011.

  1. bens_cab Forum Junkie

    Joined:
    Dec 30, 2005
    Likes Received:
    0
    Location:
    Ashford kent
    damm ill be buying an android if this is a goer trev top work i have nothing but trouble trying to get my laptop connected to the ms these days
     
  2. andyneedham2 Forum Member

    Joined:
    Mar 2, 2010
    Likes Received:
    4
    Location:
    Manchester
    Can't wait to get building ms for the Rocco. This is a genius idea. :thumbup:
     
  3. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Does anyone here have a tablet running Honeycomb?
     
  4. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Latest update

    I now have a first test version that people are welcome to try out. It's very limited in what it does on the surface, and is essentially just provides visual displays of gauges and log view graphing at the moment. It's also pretty crashy. But it will connect to the MS ECU via a Bluetooth dongle (I'll talk more about that at a later point) and you can woo at the gauges working and pretty log graphs. Obviously at this stage I have yet to start adding tuning and configuration UI controls, but everything is there ready underneath. The first test app really is a basic test thing and not much practical use at the moment. Really the main thing I want to establish it installs and works on various devices and - even more importantly - that the Bluetooth connectivity works on various devices.

    Random list of features that come to my head:

    • Connects to MS via Bluetooth (SPP profile).
    • Fully compatible with existing .ini files for each version of MegaSquirt. The application is entirely configured by the .ini file, just like the PC-based MegaSquirt tuning packages are.
    • The front user interface is a dashboard which provides you with several pages that you can swipe between. On each page you can add / delete / move / resize widgets as you please. At the moment these 'widgets' are gauges and graph view. Automatically creates a default dashboard layout to suit the screen size of your Android device (with screen density properly handled). Obviously you'll then be able to change the layout how you want and save it.
    • The log graph view can show you live data as it happens (with auto scroll), or previously recorded logs. The log view is really nice to use with very fast scrolling and zooming. It automatically re-adjusts the Y-axis min / max for a given data series on the fly if necessary and redraws instantly. If there are any gaps in the datalog for any reason, it shows them. It provdes a cursor with value markers, which at a later stage you'll be able to drag back and forth.
    • Though not working in current test software, it will be possible to select any log on your SD card and email it. Internal datalogs can be emailed out as a MegaLogViewer-compatible file you're already familiar with.
    • As part of this project I created an SVG image library for Android (none existed at the time of starting). In plain English this means that new 'widgets' (i.e. very fancy looking gauges) could be created in Illustrator (Windows) or Inkscape (freeware; Windows / Linux) and I can drop them into the application, so if anyone fancies helping to design any kind of UI elements like this, it'd be awesome.
    • The application fully supports reading / writing ECU settings and also reading / writing MSQ files, but this stuff needs completing a bit and so will be in the next test release; at present the test application comes with an MSQ file of my own which is loaded in on startup, just to give it some meaningful constants for test purposes.


    [​IMG]

    The red / blue traces are coolant and TPS. The green one is the MAP, with the wiggle caused by me blowing / sucking the tube... :lol:

    [​IMG]

    [​IMG]


    At the moment I'm looking into suitable Bluetooth adapters for the long term. In the meantime I'm soldering a few together to post to a few on here who have an Android device and MegaSquirt and would like to start playing with it. Please PM me if you'd like a link to download the .apk, which you should be able to install on your Android phone / tablet. Note that it's necessary to enable "Unknown sources" in the "Manage Applications" settings area to install it.

    Devices I'd like to test on: So far I have a HTC Desire, HTC Desire HD, and an Archos 101; and might order a Honeycomb tablet to test with as well. I could really do with trying this out on other makes and models of Android devices. Such as Motorola, Samsung, etc. The thing I'm particularly interested in is ensuring the Bluetooth connectivity works. As said, I could assemble a Bluetooth dongle to post to you if you want to test. If you don't have MegaSquirt but have a device worth testing on, it's worth installing the app anyway, and if you're not mega far away from me in Oxfordshire with an Android device I haven't tested with yet, could I pop over with the MS ECU and try it?

    Bear with me if I'm slow replying to PMs or doing much more on this project for a little while, because the wife is about to drop a sprog.
     
  5. Bruce T Forum Member

    Joined:
    Sep 30, 2010
    Likes Received:
    35
    Location:
    On the bog...
    This looks brilliant Trev!
    Great idea. Massive amount of work gone into this already. Look forward to seeing this grow into a brilliant application.
    If I had an android device (and an engine in the car) I would love to give this a go!
     
  6. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Thanks Bruce. Yeah it has been a bit of a mission.

    I assembled a Bluetooth interface to post out today to a tester.

    If anyone else has both MegaSquirt and an Android device and wants to help to test then please let me know.

    I'm currently on 'standby' with the wife still, who still hasn't popped this baby, so using the time to write more code!

    [​IMG]
     
  7. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Played around with some nice looking cursor markers on the log graph view.

    [​IMG]

    [​IMG]
     
  8. Tomo IOW Forum Member

    Joined:
    Aug 26, 2006
    Likes Received:
    0
    Location:
    Isle OF wight
    I. have ms and desire so if I wanna test let me know
     
  9. Pb81 Forum Member

    Joined:
    Jul 28, 2009
    Likes Received:
    21
    Location:
    Rome, Italy
    Tester here as well :)
     
  10. Toyotec

    Toyotec CGTI Committee - Happy helper at large Admin

    Joined:
    Jul 26, 2006
    Likes Received:
    3,324
    Location:
    Creating Pfredstarke
    Had a look at this today.

    Downloaded the application and fired up an ECU on the stim to confirm operation. I used the calibration from my 3A 8v.

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    System worked however there are few teething issues that were observed.

    Trev already made aware and I look forward to testing the next improved release.

    Here is the application running, albeit with a different ini file.

    [​IMG]
     
  11. Joe C New Member

    Joined:
    Nov 28, 2011
    Likes Received:
    0
    Hi Trev,

    I'm not a VW driver, but was pointed toward this by a collegue who is, I run Megasquirt on my turbocharged Mini, and am in the inital stages of getting the logging apps that are now available working so should be able to to do testing if required.

    Ive got a couple of those TTL-BT boards off ebay, but havent had much of a fiddle with them yet, so if I get stuck I may need an adaptor from you.
     
  12. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Awesome - thanks to Toyo for the initial test and really useful feedback. I'm currently working on some fixes for issues pointed out.

    Joe C, Pb81, Tomo - brilliant; I'll have to assemble more interfaces and / or post up details on how to assemble one.
     
  13. Pb81 Forum Member

    Joined:
    Jul 28, 2009
    Likes Received:
    21
    Location:
    Rome, Italy
    Hi Trev! I already have an interface, i just need the software ;)
    Edit: looks like my if doesnt work properly with the MS, as i tried with a different sw.. Please let me know for your one :)
    Thanks
     
    Last edited: Nov 29, 2011
  14. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Pb81, ah that's cool - what interface do you have? What version of MS are you using and what baud rate is your Bluetooth interface set to for the RS232 side? As you've not got it working so far, I wonder if it's a baud rate configuration issue. For MS1 you need 9600bps and for MS2 you require 115200bps.

    With the interfaces I use, the baud rate configuration is done by issuing an appropriate AT-command into the interface on the RS232 side. Other commercial interfaces may provide DIP switches for easy baud rate selection.

    Trev
     
  15. Pb81 Forum Member

    Joined:
    Jul 28, 2009
    Likes Received:
    21
    Location:
    Rome, Italy
    Last edited: Nov 29, 2011
  16. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Ah OK - yes, with this adapter you need to ensure that the baud rate is configured to 115200bps using a terminal program (such as HyperTerminal if you're using Windows). Have you performed this configuration? Here is the manual: http://www.epostech.co.uk/bt232.html

    This baud rate setting affects the speed of communication between the interface and MegaSquirt. It does not affect anything to do with the Bluetooth link between the Android device and the interface. Therefore, with an incorrect baud rate selection, the Bluetooth connection will work, but the MegaSquirt controller will not be found.
     
  17. Pb81 Forum Member

    Joined:
    Jul 28, 2009
    Likes Received:
    21
    Location:
    Rome, Italy
    I did set that baudrate twice but it didn't work... I'll do some more tries...[8(]
    Thank you
     
  18. Joe C New Member

    Joined:
    Nov 28, 2011
    Likes Received:
    0
    Well, I fired my Bluetooth board up last night, and while I can get a path through them (loopback confirmed on a scope) i can't get the buggers to reply to the AT codes so can't reset the Baud for MS2...

    looks like I'll be wanting an adaptor when you get a chance Trev.
     
  19. Trev16v

    Trev16v Paid Member Paid Member

    Joined:
    Oct 22, 2003
    Likes Received:
    451
    Location:
    Oxfordshireland
    Just a thought: with the Bluetooth modules I've been playing with and using successfully (the little eBay Bluetooth-TTL PCBs) their AT-command interpreter is a bit crap in the sense that it won't parse a command given at any human typing rate. They don't rely on the string being linefeed / carriage-return terminated; instead, they just want to see the command in their input buffer within a very short time. Therefore, I can only get the module to respond to an AT-command if the command is contained in a little .txt file and then is transferred over in the terminal emulator (e.g. if using Hyperterminal, use the "Send Text File" option). Furthermore, the modules I'm using do NOT want the AT-command to be carriage return / line-feed terminated and the module will not process the AT command if it does have such characters (or any other whitespace) following the AT-command string. So for example if the command to set the baud rate is AT+BAUD=115200 without CR/LF then the .txt file would contain simply:

    AT+BAUD=115200

    ...and you would have to take care to ensure that no characters, not even a linefeed, follow it.

    So if your BT module does not respond to typed commands then the text file method is worth a try.

    However, anything that supports AT-commands is supposed to reply with "OK" if you simply send "AT" to it, and this response can normally be got if you hit the A and T keys fast enough. In other words if you fire up Hyperterminal at the correct baud rate (that the module is currently at) and keep hitting A - T - A - T - A - T ... you should get "OK" a few times. Once you get that, you know you should be able to send the AT commands using a text file.

    What is your Bluetooth board?
     
  20. Joe C New Member

    Joined:
    Nov 28, 2011
    Likes Received:
    0
    Good info, thanks! I'll give it a whirl, its probably the only permutation I havent tried lol

    Interestingly I was using some TTL to 433Mhz boards earlier this year that did the reverse, would unly accept comands when typed, not a string... electronics eh!

    these are the ones...

    http://www.ebay.co.uk/itm/280696760008?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

    no info came with them but I'm asuming they are these, (or a copy of these as the sub board looks identical...)

    http://www.usconverters.com/downloads/bluetooth-module-btm5-datasheet.pdf
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice