comincio da RFObasic!
manuale pagina 181
estratto
programma tutorial:
Copyright© Paul Laughton, 2011, 2012 Page 181 De Re BASIC!
f35_bluetooth.bas
!!
This program demonstrates using bluetooth as both an application that listens for a connection
or makes a connection to a listener.
Before running this program use the Android "Settings" application to enable Bluetooth and to pair
with the device(s) that you will talk to.
This program will send and receive data bytes to and from a connected device.
You can use this program to (among many other things) set up a chat between two Android
devices.
Note: The UUID used by default is the standard serial port UUID. This can be changed. Read the manual.
!!
! Begin by opening Bluetooth
! If Bluetooth is not enabled
! the program will stop here.
bt.open
! When BT is opened, the program
! will start listening for another
! device to connect. At this time
! the user can continue to wait
! for a connection are can attempt
! to connect to another device
! that is waiting for a connection
! Ask user what to do
array.load type$[], "Connect to listener", "Continue to listen for connection", "Quit"
msg$ = "Select operation mode"
new_connection:
select type, type$[], msg$
! If the user pressed the back
! key or selected quit then quit
! otherwise try to connect to
! a listener
if (type = 0) | (type =3)
print "Thanks for playing"
bt.close
end
elseif type = 1
bt.connect
endif
! Read status until
! a connection is made
Do
bt.status s
if s = 1
print "Listening
elseif s =2
print "Connecting"
elseif s = 3
print "Connected"
endif
pause 1000
until s =3
! When a connection is made
! get the name of the connected
! device
bt.device.name device$
! *** Read/Write Loop ****
RW_Loop:
Do
! Read status to insure
! that we remain connected.
! If disconnected, program
! reverts to listen mode.
! In that case, ask user
! what to do.
bt.status s
if s<> 3
print "Connection lost"
goto new_connection
endif
! Read messages until
! the message queue is
! empty
Do
bt.read.ready rr
if rr
bt.read.bytes msg$
print device$;": ";msg$
endif
until rr = 0
! Message Queue is empty
! Send a message
! Note: If no text is entered
! then no text will be sent
Input "Text to send", msg$
if (msg$ <> "") & (msg$<> "*")
bt.write msg$
print "Me: "; msg$
endif
until msg$ = "*"
! if msg$ is "*" then close connection
! and restart
bt.close
bt.open
goto new_connection
lunedì 18 marzo 2013
quale sistema di sviluppo per android per comunicare BT?
Opzione 1: RFO-basic! per android http://laughton.com/basic/help/De_Re_BASIC%21.htm#_Toc349156658
(per editare da remoto NON usare
che fa schifo (meglio "airdroid" o "wifi file transfer")
qualcuno ci sta gia' provando:
http://rfobasic.freeforums.org/post6406.html?hilit=OBD#p6406
e come primo effetto c'e' stato un aggiornamento del BT.flush in RFObasic
Opzione2 : MIT APPInventor , in particolare l'approccio ShivalWolf al Bluetooth (qui si trovano i sorgenti)
per debuggare e' utile avere il software per PC e un portatile con Bluetooth; esempio di SW scaricabile
ovviamente la base di partenza e' una app android gia' funzionante (che e' quella che voglio imitare) che funziona sullo smartphone disponibile:
https://play.google.com/store/apps/details?id=org.prowl.torque&hl=it
e un simulatore di OBD per non andare sempre in garage a provare.
(per editare da remoto NON usare
WiFi Keyboard
Ivan Volosyuk.che fa schifo (meglio "airdroid" o "wifi file transfer")
qualcuno ci sta gia' provando:
http://rfobasic.freeforums.org/post6406.html?hilit=OBD#p6406
e come primo effetto c'e' stato un aggiornamento del BT.flush in RFObasic
Opzione2 : MIT APPInventor , in particolare l'approccio ShivalWolf al Bluetooth (qui si trovano i sorgenti)
per debuggare e' utile avere il software per PC e un portatile con Bluetooth; esempio di SW scaricabile
ovviamente la base di partenza e' una app android gia' funzionante (che e' quella che voglio imitare) che funziona sullo smartphone disponibile:
https://play.google.com/store/apps/details?id=org.prowl.torque&hl=it
e un simulatore di OBD per non andare sempre in garage a provare.
Etichette:
android,
appinventor,
bluetooth,
obd2,
rfobasic
OBD: Lista dei parametri
Lista dei parametri e degli Identificativi di parametro (numero esadecimale e decimale):
http://www.outilsobdfacile.com/obd-mode-pid.html#OBD_PIDs
MODI 1 e 2
modo 5
modo 6
modo 9
http://www.outilsobdfacile.com/obd-mode-pid.html#OBD_PIDs
MODI 1 e 2
| 00 | 00 | Determine PIDs supported (range 01h to 20h ) |
| 01 | 01 | Trouble codes and on board test information |
| 02 | 02 | Freeze frame trouble code |
| 03 | 03 | Fuel system status |
| 04 | 04 | Calculated load value |
| 05 | 05 | Coolant temperature |
| 06 | 06 | Short term fuel % trim Bank 1 |
| 07 | 07 | Long term fuel % trim Bank 1 |
| 08 | 08 | Short term fuel % trim Bank 2 |
| 09 | 09 | Long term fuel % trim Bank 2 |
| 0A | 10 | Fuel pressure |
| 0B | 11 | Intake Manifold Pressure |
| 0C | 12 | Engine RPM |
| 0D | 13 | Vehicle speed |
| 0E | 14 | Timing advance |
| 0F | 15 | Intake air temperature |
| 10 | 16 | Maf air flow |
| 11 | 17 | Absolute Throttle sensor position |
| 12 | 18 | Secondary air status |
| 13 | 19 | Oxygen sensor locations bank/sensor |
| 14 | 20 | Oxy. sensor voltage bank1 sensor1 |
| 15 | 21 | Oxy. sensor voltage bank1 sensor2 |
| 16 | 22 | Oxy. sensor voltage bank1 sensor3 |
| 17 | 23 | Oxy. sensor voltage bank1 sensor4 |
| 18 | 24 | Oxy. sensor voltage bank2 sensor1 |
| 19 | 25 | Oxy. sensor voltage bank2 sensor2 |
| 1A | 26 | Oxy. sensor voltage bank2 sensor3 |
| 1B | 27 | Oxy. sensor voltage bank2 sensor4 |
| 1C | 28 | Design OBD requirements |
| 1D | 29 | Alternate Oxy sensor locations |
| 1E | 30 | Auxilliary input status |
| 1F | 31 | Time since engine start |
| 20 | 32 | Determine PIDs supported (range 21h to 40h ) |
| 21 | 33 | Distance traveled while MIL is activated |
| 22 | 34 | Fuel rail pressure relative manifold |
| 23 | 35 | Fuel rail pressure |
| 24 | 36 | Bank 1 - sensor 1 (wide range O2S) |
| 25 | 37 | Bank 1 - sensor 2 (wide range O2S) |
| 26 | 38 | Bank 1 - sensor 3 (wide range O2S) |
| 27 | 39 | Bank 1 - sensor 4 (wide range O2S) |
| 28 | 40 | Bank 2 - sensor 1 (wide range O2S) |
| 29 | 41 | Bank 2 - sensor 2 (wide range O2S) |
| 2A | 42 | Bank 2 - sensor 3 (wide range O2S) |
| 2B | 43 | Bank 2 - sensor 4 (wide range O2S) |
| 2C | 44 | Commanded EGR |
| 2D | 45 | EGR error |
| 2E | 46 | Commanded evaporative purge |
| 2F | 47 | Fuel level input |
| 30 | 48 | Number of warn-ups since DTCs cleared |
| 31 | 49 | Distance traveled since DTCs cleared |
| 32 | 50 | Evap system vapor pressure |
| 33 | 51 | Barometric pressure |
| 34 | 52 | Bank 1 - sensor 1 (wide range O2S) |
| 35 | 53 | Bank 1 - sensor 2 (wide range O2S) |
| 36 | 54 | Bank 1 - sensor 3 (wide range O2S) |
| 37 | 55 | Bank 1 - sensor 4 (wide range O2S) |
| 38 | 56 | Bank 2 - sensor 1 (wide range O2S) |
| 39 | 57 | Bank 2 - sensor 2 (wide range O2S) |
| 3A | 58 | Bank 2 - sensor 3 (wide range O2S) |
| 3B | 59 | Bank 2 - sensor 4 (wide range O2S) |
| 3C | 60 | Catalyst Temperature bank 1, sensor 1 |
| 3D | 61 | Catalyst Temperature bank 2, sensor 1 |
| 3E | 62 | Catalyst Temperature bank 1, sensor 2 |
| 3F | 63 | Catalyst Temperature bank 2, sensor 2 |
| 40 | 64 | Determine PIDs supported (range 41h to 60h ) |
| 41 | 65 | Monitor status this driving cycle |
| 42 | 66 | Control module voltage |
| 43 | 67 | Absolute load value |
| 44 | 68 | Fuel/air commanded equivalence ratio |
| 45 | 69 | Relative throttle position |
| 46 | 70 | Ambiant air temperature |
| 47 | 71 | Absolute throttle position B |
| 48 | 72 | Absolute throttle position C |
| 49 | 73 | Accelerator pedal position D |
| 4A | 74 | Accelerator pedal position E |
| 4B | 75 | Accelerator pedal position F |
| 4C | 76 | Commanded throttle actuator control |
| 4D | 77 | Engine run time while MIL is activated |
| 4E | 78 | Engine run time since DTCs cleared |
| 4F | 79 | External test equipment configuration information #1 |
| 50 | 80 | External test equipment configuration information #2 |
| 51 | 81 | Type of fuel currently being utilized by the vehicule |
| 52 | 82 | Alcohol fuel pourcentage |
| 53 | 83 | Absolute evap system vapor pressure |
| 54 | 84 | Evap system vapor pressure |
| 55 | 85 | Short term secondary O2 sensor fuel trim - bank 1 and 3 |
| 56 | 86 | Long term secondary O2 sensor fuel trim - bank 1 and 3 |
| 57 | 87 | Short term secondary O2 sensor fuel trim - bank 2 and 4 |
| 58 | 88 | Long term secondary O2 sensor fuel trim - bank 2 and 4 |
| 59 | 89 | Fuel rail pressure (absolute) |
| 5A | 90 | Relative accelerator pedal position |
| 5B | 91 | Hybrid battery pack remaining life |
| 5C | 92 | Engine oil temperature |
| 5D | 93 | Fuel injection timing |
| 5E | 94 | Engine fuel rate |
| 5F | 95 | Emission requirements to which vehicule is designed |
| 60 | 96 | Determine PIDs supported (range 61h to 80h ) |
| 61 | 97 | Driver's demand engine - percent torque |
| 62 | 98 | Actual engine - percent torque |
| 63 | 99 | Engine reference torque |
| 64 | 100 | Engine percent torque data |
| 65 | 101 | Auxiliary inputs / outputs |
| 66 | 102 | Mass air flow sensor |
| 67 | 103 | Engine coolant temperature |
| 68 | 104 | Intake air temperature sensor |
| 69 | 105 | Commanded EGR and EGR error |
| 6A | 106 | Commanded diesel intake air flow control and relative intake air flow position |
| 6B | 107 | Exhaust gas recirculation temperature |
| 6C | 108 | Commanded throttle actuator control and relative throttle position |
| 6D | 109 | Fuel pressure control system |
| 6E | 110 | Injection pressure control system |
| 6F | 111 | Turbocharger compressor inlet pressure |
| 70 | 112 | Boost pressure control |
| 71 | 113 | Variable geometry turbo (VGT) control |
| 72 | 114 | Wastegate control |
| 73 | 115 | Exhaust pressure |
| 74 | 116 | Turbocharger RPM |
| 75 | 117 | Turbocharger A temperature |
| 76 | 118 | Turbocharger B temperature |
| 77 | 119 | Charge air cooler temperature (CACT) |
| 78 | 120 | Exhaust gas temperature (EGT) bank 1 |
| 79 | 121 | Exhaust gas temperature (EGT) bank 2 |
| 7A | 122 | Diesel particulate filter (DPF) bank 1 |
| 7B | 123 | Diesel particulate filter (DPF) bank 2 |
| 7C | 124 | Diesel particulate filter (DPF) temperature |
| 7D | 125 | Nox NTE control area status |
| 7E | 126 | PM NTE control area status |
| 7F | 127 | Engine run time |
| 80 | 128 | Determine PIDs supported (range 81h to A0h ) |
| 81 | 129 | Engine run time for AECD #1 - #5 |
| 82 | 130 | Engine run time for AECD #6 - #10 |
| 83 | 131 | Nox sensor |
| 84 | 132 | Manifold surface temperature |
| 85 | 133 | Nox control system |
| 86 | 134 | Particulate matter (PM) sensor |
| 87 | 135 | Intake manifold absolute pressure |
| 88 | 136 | ISO/SAE reserved |
| 89 | 137 | Determine PIDs supported (range A1h to C0h ) |
| 8A | 138 | Determine PIDs supported (range C1h to E0h ) |
| 8B | 139 | Determine PIDs supported (range E1h to FFh ) |
modo 5
| 00 | 00 | Determine PIDs supported (range 01h to 20h ) |
| 01 | 01 | Rich to lean sensor threshold voltage |
| 02 | 02 | Lean to rich sensor threshold voltage |
| 03 | 03 | Low sensor voltage for switch time calculation |
| 04 | 04 | High sensor voltage for switch time calculation |
| 05 | 05 | Rich to lean sensor switch time |
| 06 | 06 | Lean to rich sensor switch time |
| 07 | 07 | Minimum sensor voltage for test cycle |
| 08 | 08 | Maximum sensor voltage for test cycle |
| 09 | 09 | Time between sensor transitions |
| 0A | 0A | Sensor period |
| 0B | 0B | ISO/SAE reserved |
modo 6
| 0 | 0 | Determine PIDs supported (range 01h to 20h ) |
| 1 | 1 | Exhaust Gas Sensor Monitor Bank 1 - Sensor 1 |
| 2 | 2 | Exhaust Gas Sensor Monitor Bank 1 - Sensor 2 |
| 3 | 3 | Exhaust Gas Sensor Monitor Bank 1 - Sensor 3 |
| 4 | 4 | Exhaust Gas Sensor Monitor Bank 1 - Sensor 4 |
| 5 | 5 | Exhaust Gas Sensor Monitor Bank 2 - Sensor 1 |
| 6 | 6 | Exhaust Gas Sensor Monitor Bank 2 - Sensor 2 |
| 7 | 7 | Exhaust Gas Sensor Monitor Bank 2 - Sensor 3 |
| 8 | 8 | Exhaust Gas Sensor Monitor Bank 2 - Sensor 4 |
| 9 | 9 | Exhaust Gas Sensor Monitor Bank 3 - Sensor 1 |
| 0A | 10 | Exhaust Gas Sensor Monitor Bank 3 - Sensor 2 |
| 0B | 11 | Exhaust Gas Sensor Monitor Bank 3 - Sensor 3 |
| 0C | 12 | Exhaust Gas Sensor Monitor Bank 3 - Sensor 4 |
| 0D | 13 | Exhaust Gas Sensor Monitor Bank 4 - Sensor 1 |
| 0E | 14 | Exhaust Gas Sensor Monitor Bank 4 - Sensor 2 |
| 0F | 15 | Exhaust Gas Sensor Monitor Bank 4 - Sensor 3 |
| 10 | 16 | Exhaust Gas Sensor Monitor Bank 4 - Sensor 4 |
| 11 | 17 | Determine PIDs supported (range 21h to 40h ) |
| 12 | 18 | Catalyst Monitor Bank 1 |
| 13 | 19 | Catalyst Monitor Bank 2 |
| 14 | 20 | Catalyst Monitor Bank 3 |
| 15 | 21 | Catalyst Monitor Bank 4 |
| 16 | 22 | EGR Monitor Bank 1 |
| 17 | 23 | EGR Monitor Bank 2 |
| 18 | 24 | EGR Monitor Bank 3 |
| 19 | 25 | EGR Monitor Bank 4 |
| 1A | 26 | VVT Monitor Bank 1 |
| 1B | 27 | VVT Monitor Bank 2 |
| 1C | 28 | VVT Monitor Bank 3 |
| 1D | 29 | VVT Monitor Bank 4 |
| 1E | 30 | EVAP Monitor (Cap Off / 0.150") |
| 1F | 31 | EVAP Monitor (0.090") |
| 20 | 32 | EVAP Monitor (0.040") |
| 21 | 33 | EVAP Monitor (0.020") |
| 22 | 34 | Purge Flow Monitor |
| 23 | 35 | Determine PIDs supported (range 41h to 60h ) |
| 24 | 36 | Exhaust Gas Sensor Heater Monitor Bank 1 - Sensor 1 |
| 25 | 37 | Exhaust Gas Sensor Heater Monitor Bank 1 - Sensor 2 |
| 26 | 38 | Exhaust Gas Sensor Heater Monitor Bank 1 - Sensor 3 |
| 27 | 39 | Exhaust Gas Sensor Heater Monitor Bank 1 - Sensor 4 |
| 28 | 40 | Exhaust Gas Sensor Heater Monitor Bank 2 - Sensor 1 |
| 29 | 41 | Exhaust Gas Sensor Heater Monitor Bank 2 - Sensor 2 |
| 2A | 42 | Exhaust Gas Sensor Heater Monitor Bank 2 - Sensor 3 |
| 2B | 43 | Exhaust Gas Sensor Heater Monitor Bank 2 - Sensor 4 |
| 2C | 44 | Exhaust Gas Sensor Heater Monitor Bank 3 - Sensor 1 |
| 2D | 45 | Exhaust Gas Sensor Heater Monitor Bank 3 - Sensor 2 |
| 2E | 46 | Exhaust Gas Sensor Heater Monitor Bank 3 - Sensor 3 |
| 2F | 47 | Exhaust Gas Sensor Heater Monitor Bank 3 - Sensor 4 |
| 30 | 48 | Exhaust Gas Sensor Heater Monitor Bank 4 - Sensor 1 |
| 31 | 49 | Exhaust Gas Sensor Heater Monitor Bank 4 - Sensor 2 |
| 32 | 50 | Exhaust Gas Sensor Heater Monitor Bank 4 - Sensor 3 |
| 33 | 51 | Exhaust Gas Sensor Heater Monitor Bank 4 - Sensor 4 |
| 34 | 52 | Determine PIDs supported (range 61h to 80h ) |
| 35 | 53 | Heated Catalyst Monitor Bank 1 |
| 36 | 54 | Heated Catalyst Monitor Bank 2 |
| 37 | 55 | Heated Catalyst Monitor Bank 3 |
| 38 | 56 | Heated Catalyst Monitor Bank 4 |
| 39 | 57 | Secondary Air Monitor 1 |
| 3A | 58 | Secondary Air Monitor 2 |
| 3B | 59 | Secondary Air Monitor 3 |
| 3C | 60 | Secondary Air Monitor 4 |
| 3D | 61 | Determine PIDs supported (range 81h to A0h ) |
| 3E | 62 | Fuel System Monitor Bank 1 |
| 3F | 63 | Fuel System Monitor Bank 2 |
| 40 | 64 | Fuel System Monitor Bank 3 |
| 41 | 65 | Fuel System Monitor Bank 4 |
| 42 | 66 | Boost Pressure Control Monitor Bank 1 |
| 43 | 67 | Boost Pressure Control Monitor Bank 2 |
| 44 | 68 | NOx Adsorber Monitor Bank 1 |
| 45 | 69 | NOx Adsorber Monitor Bank 2 |
| 46 | 70 | NOx Catalyst Monitor Bank 1 |
| 47 | 71 | NOx Catalyst Monitor Bank 2 |
| 48 | 72 | Determine PIDs supported (range A1h to C0h ) |
| 49 | 73 | Misfire Monitor General Data |
| 4A | 74 | Misfire Cylinder 1 Data |
| 4B | 75 | Misfire Cylinder 2 Data |
| 4C | 76 | Misfire Cylinder 3 Data |
| 4D | 77 | Misfire Cylinder 4 Data |
| 4E | 78 | Misfire Cylinder 5 Data |
| 4F | 79 | Misfire Cylinder 6 Data |
| 50 | 80 | Misfire Cylinder 7 Data |
| 51 | 81 | Misfire Cylinder 8 Data |
| 52 | 82 | Misfire Cylinder 9 Data |
| 53 | 83 | Misfire Cylinder 10 Data |
| 54 | 84 | Misfire Cylinder 11 Data |
| 55 | 85 | Misfire Cylinder 12 Data |
| 56 | 86 | Misfire Cylinder 13 Data |
| 57 | 87 | Misfire Cylinder 14 Data |
| 58 | 88 | Misfire Cylinder 15 Data |
| 59 | 89 | Misfire Cylinder 16 Data |
| 5A | 90 | PM Filter Monitor Bank 1 |
| 5B | 91 | PM Filter Monitor Bank 2 |
| 5C | 92 | Determine PIDs supported (range C1h to E0h ) |
| 5D | 93 | Determine PIDs supported (range E1h to FFh ) |
| 5E | 94 | Manufacturer specific |
modo 9
| 00 | 00 | Determine PIDs supported (range 01h to 20h ) |
| 01 | 01 | MessageCount VIN |
| 02 | 02 | Vehicle Identification Number |
| 03 | 03 | MessageCount CALID |
| 04 | 04 | Calibration Identifications |
| 05 | 05 | MessageCount CVN |
| 06 | 06 | Calibration Verification Numbers |
| 07 | 07 | MessageCount IPT |
| 08 | 08 | In-use Performance Tracking |
| 09 | 09 | MessageCount ECU name |
| 0A | 10 | ECU name |
| 0B | 11 | In-use Performance Tracking |
| 0C-FF | 12-255 | ISO/SAE reserved |
Iscriviti a:
Post (Atom)