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
- $$$: put the WiFly into command mode
- set comm close 0 (that is number zero) : stop the module sending status message when network connection is closed.
- set comm open 0 (again, number zero): stop the module sending status message when network connection is open.
- set uart mode 0x10 (hex 10): clear all waiting data if connection is closed
- set uart baud 57600: I have not tried it at 115200 but should work
- set sys printlvl 0 (again, number zero): stop misc status messages being sent to RS232
- set ip host ___.__.___ (my computer IP address here)
- set ip remote_port ____ (this just has to match my C# port)
- set sys autoconn 10
- save
- reboot
- cycle the power on the WiFly
Commands to send from C# app to CAN232:
- "" // clear the buffer
- "C" // close CAN232 just in case it was left open from previous
- "V" // get CAN232 Version
- "N" // get CAN232 Serial
- "S6" // set the CAN bus speed to 500Kbit
- "M48000400" // set acceptance code register
- "m31EFBBEF" // set acceptance mask resister
- "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
No comments:
Post a Comment