Saturday, January 5, 2013

Argggg!!!! Apple Provision!!!


[04:30 pm]
Code Sign error: The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains

I hate code signing... This is getting nowhere fast.  I had to reinstall my OS and now, I can't download the code that was building before...

[8:11 pm]
Whew!  That took forever to figure out!  

Wednesday, December 26, 2012

Text mode!

Progress Report:

  1. I am able to initiate a connection from my iPad to Wifly to the CAN232.
  2. Bidirectional data flows
  3. Raw CAN Data is being saved to a file on iPad
  4. CAN data parser has been ported!
  5. Text data is being displayed on my iPad as I get data from Wifly<-CAN232!
  6. Implemented playback so the previously saved data can be played back on iPad(still text mode).

Todo:

  1. Create a circular gauge that I can use
  2. Display the parsed CAN data on circular gauge rather than using label as text.

Link to Dropbox : Playback on iPad Simulator  (still text mode).
Link to Dropbox : Playback on my old Windows App (all done in c# years ago) :)

Sunday, December 2, 2012

Playback...

Not much progress...  So far, I can connect to WiFly and record from my PC but not from iPad...
Video below is from an app I wrote more than 2 years ago to playback the data I recorded several days ago.   Yes, I know...  It is ugly... :) But the entire thing was written using C# and no photoshop was involved...  iPad version will not be this ugly... hopefully of course... :)

Wow!  Video compression made this even uglier!!!!








Friday, November 23, 2012

First contact!

It took me about 30 minutes to write a simple socket server application in C# but it took me FOREVER (OK, about 4 hours) to figure out how to configure the WiFly to talk back using socket.  Then it took me another FOREVER(again, about 4 hours) to figure out how to make the commands I am sending from C# app thru WiFly to CAN232 and retrieve the CAN data back from CAN232.


How to configure the WiFly:
Following was done using WiFlyClient app on my iPad.
[Edit] Just found out this can also be done using Terminal app on Mac.  telnet 169.254.1.1 2000
  1. $$$: put the WiFly into command mode 
  2. set comm close 0 (that is number zero)  : stop the module sending status message when network connection is closed.
  3. set comm open 0 (again, number zero): stop the module sending status message when network connection is open.
  4. set uart mode 0x10 (hex 10): clear all waiting data if connection is closed
  5. set uart baud 57600:  I have not tried it at 115200 but should work
  6. set sys printlvl 0 (again, number zero): stop misc status messages being sent to RS232
  7. set ip host ___.__.___ (my computer IP address here)
  8. set ip remote_port ____ (this just has to match my C# port)
  9. set sys autoconn 10
  10. save
  11. reboot
  12. cycle the power on the WiFly
Commands to send from C# app to CAN232:
  1. ""               // clear the buffer
  2. "C"            // close CAN232 just in case it was left open from previous
  3. "V"           // get CAN232 Version
  4. "N"           // get CAN232 Serial
  5. "S6"          // set the CAN bus speed to 500Kbit
  6. "M48000400"     // set acceptance code register
  7. "m31EFBBEF"  // set acceptance mask resister
  8. "O"                     // open the CAN channel

Sample data retrieved from CAN232:
t03A70000000024E247
t03E3173890
t0387C0000800000007
t03B5000E00EA38
t030884000000002000DC
t03A70000000024E247
t0203000007
t0387C0000800000007
t03A70000000024E348
t039429020F77
t0387C0000800000007
t03E3173890
t0387C0000800000007
t03B5000E00EA38
t039429020F77
t03A70000000024E247
t03E3173890
t0387C0000800000007
t3486000100000052
t030884000000002000DC
t0387C0000800000007
t0203000007
t022801FB01FC00000023

Wednesday, November 21, 2012

WiFly arrives

It is here!  The people at Roving Networks are extremely fast on shipping.
One thing to note is that the blinking lights are very annoying.
Time to write some code to get/set data from/to the WiFly <-> CAN232!!!

Front

Back



Blinking lights... :)


Sunday, November 18, 2012

iCAN View Prius 2 Started!

I've started a new weekend project!  When finished, it will allow me to view, record, playback, and analyze the CAN BUS data from my 2nd generation Prius on my iPad.  Why you may ask?  I have an answer.  Because, I can CAN232. :)

This will be multi-stage project that will evolve on each versions.
Version 1:  Targeted to work only on 2nd generation Prius and UI will be "fixed" so the end users cannot change the layout.
Version 2:  Allow the end-users to arrange the layout.
Version 3:  Integration to Raspberry-PI/CAN USB.
Version 4: Don't know yet :)

I "lied." :)  I've already written similar application about 2-3 years ago on Windows platform.  So, now, I am in the process of "porting" windows application to iPad.

Hardware required is listed below.  Luckily, I've had most of these from my previous project.

CAN232 : this interface allows me to connect my car's OBDII port for CAN data to a RS232.  Both sides have DB9 connectors but must be connected correctly to the right sides.  $109.00

OBD2 cable to RJ45:  this is a generic OBD2 to ScanGuageII.  $13.95

RJ45 to DB9 connector:  I've used a QVS CC439.  $3.99

Wi-Fi Serial adapter:  This allows a serial device to become WiFi! :)  $99.00


Step 1)  Wire RJ45 to DB9.
End of OBD2 cable looks like this.  Wire pinout of OBD2 cable can be obtained from here.


RJ45 to DB9:




When finished wiring, it looks like this.



Step 2) Connect the RJ45/DB9 to CAN232:
Make sure to connect RJ45/DB9 to CAN side of the CAN232.