iPhone app

All Megasquirt 1 support questions. See also the Documentation

Moderators: jsmcortina, muythaibxr

frenchsquared
MS/Extra Newbie
Posts: 20
Joined: Wed Aug 11, 2010 5:45 am

Re: iPhone app

Post by frenchsquared »

I want a copy. I am running MS1 and have an iPhone 4. I will even donate to the cause.
Please let me know when you are ready for users.
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

I received my RN-134 this morning. I already had a suitable block connector to suit the RS232 header on the board so it was just a case of wiring a DB-9 plug up to the connector and, after triple checking everything, plugged it into my test MS (v3) and was happy to see a christmas tree display of lights and a network visible form both my iPhone and my Mac.

I used the RS232 link to supply the power as I'm running a v3 board in my test rig. My current "live" setups are v2.2 boards so IIRC I'll need to modify those to provide 5v on pin 9 of the DB-9 but it's a lot easier than messing around with batteries. The v3 board already has this so is plug and play.

I configured the on-board jumper to set the board to AdHoc mode and powered up the Megasquirt on the stim.

I connected from my Mac to start off with, connecting to the broadcast adhoc network. You must also disconnect or disable your ethernet connection, otherwise any connection attempts will probably go through your LAN connections rather than through the WiFi link.

I used the built in Mac OSX Terminal tool to open a shell session and used telnet:

Code: Select all

telnet 169.254.1.1 2000
Entering command mode ($$$ <cr>)I then ran the following commands to configure it to play nice with the Megasquirt...

Code: Select all

set uart baud 9600
set uart flow 0
set uart mode 0x10
set comm open 0
set comm close 0
set sys printlvl 0
save
Note that the "set sys printlvl 0" part and probably the two "set comm" commands are vital as without these settings the module sends confusing characters to the Megasquirt on power up that stop the Megasquirt running.. took me a while to figure that one out :)

After power cycling the Megasquirt and module I then connected my iPhone to the AdHoc network, launched the MobiSquirt app, adjusted the host and port (169.254.1.1 2000) and as soon as I tapped save it connected and started displaying the data... very happy :)

There is still a bit of fine tuning to play with, in particular I think the way the module buffers and sends it's data via tcp/ip needs adjusting to get the best response/throughput but the module itself does the job perfectly. Even in the RN-134 form the module is small enough to easily sit inside the Megasquirt case although it'll need an external aerial plugging in. I'm going to build mine into a large keyfob case so I can easily move it from vehicle to vehicle.
Last edited by DaveW on Tue Oct 19, 2010 3:45 am, edited 1 time in total.
onslack
MS/Extra Newbie
Posts: 16
Joined: Thu Aug 24, 2006 4:02 am
Location: Westsussex, UK

Re: iPhone app

Post by onslack »

if your looking for a tester i have a jailbroken iphone 3g :D

really looking forward to this coming out :D
Image
24c
Master MS/Extra'er
Posts: 847
Joined: Tue Jan 20, 2009 10:21 am
Location: Lancashire UK
Contact:

Re: iPhone app

Post by 24c »

DaveW wrote:I received my RN-134 this morning....
and you've been busy. Looking good and excellent news.

My RN-134 was faulty, so they are sending out a new one. I only used the 9V battery because it came with a PP9 connector, and always intended to drive it off pin 9, because it awakes from sleep, powers up automatically etc with this option. The board itself is tiny and would easily fit within a MicroSquirt case, but I've no idea what the signal strength would drop to without an aerial. I fancied keeping the DB9 connector option, so I could switch it between MicroSquirt & Modules, as it'll be more useful than hard wiring it in.
Yamaha GTS1000 v2 MicroSquirt, B&G 2.891
Yamaha GTS1000 v3 beta MicroSquirt, B&G3.760
Yamaha GTS1000 MSExtra 3.1, Dual VR Board
Yamaha YZF1000 MSExtra 3.1
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

During the week I've been playing further with the RN-134 module and adding some new functions/features to the iPhone app.

I tried fine tuning the comms setup between the module and the app to try and get the best data logging rate on the phone that I could. So far the factory default settings for 9600 baud actually seem to be the best option as it seemed that any changes I tried making had a negative impact on the logging rate. Using the default settings I'm getting a consistent 14 rows per second, I tried setting the WiFi "flush" value to 39 bytes (the size of the data transferred) and the timeout and all I did was manage to reduce the logging to 10 rows per second even when I drastically reduced the screen refresh rate.

I've come to the conclusion that the phone, even with all the on screen gauges and indicators being updated, is more than capable of processing all the data it's actually the data comms that is a bigger limiting factor than I'd expected.

It's worth noting that the pinout of the DB9 is a bit "odd" on the MegaSquirt boards. I have been using pin 9 for power on my test MS which is a V3 board and it worked fine. The V2.2 board that runs my LS1 has pin 9 tied to ground. I thought at first I would have to modify the V2.2 ECUs (I have two of them on different vehicles) to provide 5v on pin 9 but studying the schematics reveals that they have 5v on pin 1 instead. The V3 boards also bring 5v out on pin 1 so by using pin 1 instead of pin 9 it will run on any of my ECUs.

I've attached a datalog file from this afternoon's trip around the block. You'll note it includes x and y accelerometer raw values, I was a bit wary of updating the values too frequently and impacting the performance at this point so it's only refreshing the accelerometer value each second at the moment.
datalog201010231516.xls
I'll upload some screen shots of the app shortly as it's very nearly ready for people to test it and any feedback would be useful.
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

Made a short video clip of the app in operation...

http://www.youtube.com/watch?v=MhNojpF4qKQ

Still some tidying up to do but getting there !

The blue progress bar at the bottom of the screen shows the current communications status, a full bar means it's downloaded all the page data from the MS unit and is receiving realtime data.

The video shows choosing a different value to show for one of the gauges and setting warning and alarm values, currently these are shown on the gauge but I haven't decided how to further "alert" the user to a gauge entering a warning or alarm area. I'm still adding new gauge values to the available list.
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Re: iPhone app

Post by UnaClocker »

That's fantastic. It's getting very functional. Have you tried it with an MS2 yet?
Brian
'84 Dodge Rampage
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

UnaClocker wrote:That's fantastic. It's getting very functional. Have you tried it with an MS2 yet?
I have and it does work after a fashion. I have implemented the different comms protocol but the MS2-Extra I'm using doesn't like powering up with the WiFi adaptor for reasons I've yet to figure out. It's fine if you power the MS2 up and then plug the WiFi adaptor in. It looks like one or the other (or maybe both) are sending something down the RS232 port at power up that the other doesn't like. I'm assuming at the moment that it's the MS2 that is sending something out on power up and doesn't like the response it's getting from the adaptor.

I still need to map the data locations for MS2 too so although it communicates and kind of works the data display is using the wring values at the moment. I am considering (RN-134 specific) getting the iPhone app to reconfigure the RS232 connection based on a user preference so it'll change the baud rate of the RN-134 automatically if you select MS2 versus MS1 so you can move from one MS version to another without reconfiguring the WiFi adaptor "manually".
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: iPhone app

Post by jsmcortina »

I bet it is the bootloader misfeature that enters monitor mode if you hold the CPU RX line low at power-on.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: iPhone app

Post by racingmini_mtl »

If this is the case (which is very likely), a weak pullup on the RX line might be sufficient to work around that without affecting the data transmission.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
24c
Master MS/Extra'er
Posts: 847
Joined: Tue Jan 20, 2009 10:21 am
Location: Lancashire UK
Contact:

Re: iPhone app

Post by 24c »

DaveW, I know you are using the RN-134 at the moment, but have you seen these devices? http://www.avisaro.com/tl/wlan-logger-module.html

They are essentially the same as an RN-134 with a modular approach. So you'd start off with the microprocessor board with a RS232 to TTL converter and add a WiFi module to achieve the same. Cost might be about the same, and the documentation looks pretty good as well.

Great progress 8)
Yamaha GTS1000 v2 MicroSquirt, B&G 2.891
Yamaha GTS1000 v3 beta MicroSquirt, B&G3.760
Yamaha GTS1000 MSExtra 3.1, Dual VR Board
Yamaha YZF1000 MSExtra 3.1
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

jsmcortina wrote:I bet it is the bootloader misfeature that enters monitor mode if you hold the CPU RX line low at power-on.

James
I hooked it up via a breakout box so I could monitor what was going on. On power up the RN-134 module holds its TX high for about a second while it initialises. The MSII doesn't like this and immediately stops running. Is the rx line inverted through the RS232 chip causing the RX at the CPU to go low ?

I'll contact the RN-134 manufacturers and see if there is a way of stopping it doing this at power on but any possible alternative solutions gratefully received !
24c
Master MS/Extra'er
Posts: 847
Joined: Tue Jan 20, 2009 10:21 am
Location: Lancashire UK
Contact:

Re: iPhone app

Post by 24c »

DaveW wrote:On power up the RN-134 module holds its TX high for about a second while it initialises....
Does it still do this if you have the module in wake up mode? IIRC, the module can scan the serial port for activity, and I'm wondering if this might initialise the module differently. Are you powering up the module via pin 9 or from an external source to the board?

PS I also read the labels RX & TX for the UART are labelled the wrong way round on the board, but you shouldn't be using this with your breakout board.
Yamaha GTS1000 v2 MicroSquirt, B&G 2.891
Yamaha GTS1000 v3 beta MicroSquirt, B&G3.760
Yamaha GTS1000 MSExtra 3.1, Dual VR Board
Yamaha YZF1000 MSExtra 3.1
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

I'm powering the module from pin 1 (9 only works on v3 boards) so I think the problem is that the module and the MS are powering up together. The tx pin of the module going high while it initialises puts the MS2 into boot mode. If I connect to the module and hit return I get a ?> prompt which I assume is the MS2.

I think all this is happening before the module loads its config but I've tried changing all the settings I can find including the sys trig settings (tried 0, 1 and 2).

The simple workaround for MS2 users is to power the module off a battery rather than from the MS but it'd be better if it plays nicely, I'll see if RN come up with an answer.
ThatGuy
Helpful MS/Extra'er
Posts: 46
Joined: Thu Sep 30, 2010 1:14 pm

Re: iPhone app

Post by ThatGuy »

DaveW wrote:Made a short video clip of the app in operation...

http://www.youtube.com/watch?v=MhNojpF4qKQ

Still some tidying up to do but getting there !

The blue progress bar at the bottom of the screen shows the current communications status, a full bar means it's downloaded all the page data from the MS unit and is receiving realtime data.

The video shows choosing a different value to show for one of the gauges and setting warning and alarm values, currently these are shown on the gauge but I haven't decided how to further "alert" the user to a gauge entering a warning or alarm area. I'm still adding new gauge values to the available list.
I have read thru this whole thread now and decided that I too would really like to give this program a shot and be a tester as well.
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

Good news on the RN-134 front.

Had a reply from RN this morning and a suggested solution. In summary, the problem is caused because the base module leaves it's IO in a high impedance state while it initialises which is fine for UART use but this causes the RS232 chip to go high on it's output. The solution they've suggested, and I'm happy to say it works, is to use a pull up resistor between the UART TX (the RS232 input) and a 3.3v supply. The connections are available on the 12 way header so all you need to do is put a min 1K resistor between pin 1 and pin 4 of the 12 way header. Their support guy suggested that a 10k resistor would do the job too although he used 1k in his testing and a pack of 1k happened to be sat on my bench so that's what I used too.

It now works fine on both MS1 and MS2 with this resistor in place and I'm very impressed with RN support :)

I can get back to programming again now !
morris
MS/Extra Newbie
Posts: 16
Joined: Mon Sep 19, 2005 12:59 pm

Re: iPhone app

Post by morris »

Hey Dave W,

I am super excited to see that you are working on this and have gotten so far along with it. I have been wanting to do this myself for some time but I have not moved very far along with it and the fact of the matter is that I have many other things I really need to focus on... (including reassembling my squirted MG midget!). I would very much like to be a part of this project in whatever way I can.

Do you have any plans for table editing with your app?

Morris
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Re: iPhone app

Post by UnaClocker »

I'm not as much interested in table editting as being able to change settings on the fly, change the EGO authority/PID settings, launch control settings, generic output port settings.. Idle control settings.. I don't see how you'd be able to get much tuning done on such a small screen (though it'd probably rock on an iPad).. But being able to get at some of the commonly tweaked settings would be pretty handy.
Brian
'84 Dodge Rampage
morris
MS/Extra Newbie
Posts: 16
Joined: Mon Sep 19, 2005 12:59 pm

Re: iPhone app

Post by morris »

Working with tables on the small screen is challenging. But I played around with PalmTune quite a bit in preparation for this project and I have developed a few theories on maximizing functionality on the small screen which I would be happy to share with you if you are interested.
DaveW
Experienced MS/Extra'er
Posts: 151
Joined: Mon May 17, 2004 9:05 am
Location: North Yorkshire, UK
Contact:

Re: iPhone app

Post by DaveW »

The roadmap at the moment is to release in 3 major versions. The first version will be "read only" in that it will allow you to see realtime data, log the data (retrievable from the iPhone using iTunes) and play logs back. I'm currently in the process of completing the log playback and once that is complete I'll start notifying testers and requesting their iPhone ID so they can be added to the testing group. You will not need a jailbroken phone to test or run the app, all development is being done within Apple guidelines and under my Apple developer ID.

Before the first version is released to the app store I intend to have it supporting and working with MS1, MS2, MS1-Extra and MS2-Extra although initial testing versions will be limited to MS1-Extra initially. That's simply because I run two vehicles on MS1-Extra myself so it was given priority at the start :)

The second version will include the ability to perform basic tuning functions, changing VE and Spark tables for certain, possibly some limited setting changes beyond that. Any suggestions/ideas on the best way to provide an interface for this or any other parts of the app are always welcome. I'm pretty certain that the multi-touch capabilities give some interesting possibilities, for example holding one finger on the cell/point you want to modify and using a pinch or swipe gesture to change the value.

The third version will extend the number of settings that can be changed in the app as much as I can.

At some point in all that I'll be adding support for MS3 I suspect and I've also been asked about supporting MicroSquirt but that will depend on time and the availability of the hardware for testing against. I should also (hopefully) be getting access to an iPad at some point and will add iPad support as well. Not sure exactly when each of these will be added into the process.

Obviously it's early days yet though !
Post Reply