Page 1 of 1

CAN frame receive and send sms

Posted: Thu 4. Feb 2016, 10:51
by giaco
Hello, here's the problem: for a project, I have to use the PCAN-GPRS link and uvision 4 with the base project "PCAN-GPRS Link Example Projekt V1.6.2" and the GNU compiler.

I format an SD card 1GB and I puts the file "FirmCRC.bin", "crc.txt" and "Update.ini" after each compilation. Is that the only files to recover?

I must receive a CAN frame of a colleague using PCAN-basic, frames which give me the values of "engine oil temperature, fuel level, .."
I then have to send these values by sms to another colleague.
And I do not know how to do all this, I do not know what code to write, or what page.

If someone could help me. thank you beforehand.

Re: CAN frame receive and send sms

Posted: Fri 5. Feb 2016, 08:25
by S.Michaelsen
Hello.

Yes, this is the only way to flash the new wirmware without overwriting the bootloader.

There is an file called sms.c that contains an example how to send an sms and some others (like can.c) that shows how the CAN bus could be stardet and how messages could be read. I guess that would be good examples to modify for your own needs.

BR,
Stephan

Re: CAN frame receive and send sms

Posted: Tue 8. Mar 2016, 15:41
by giaco
Thank you. Once the GPS data and OBDII Receipts, where are they?
I have to send the details by sms, and I do not find their location.

Re: CAN frame receive and send sms

Posted: Tue 8. Mar 2016, 16:22
by S.Michaelsen
If valid data is avalible it will be written to the structure called pi of type S_PROCESSIMAGE.

Re: CAN frame receive and send sms

Posted: Tue 8. Mar 2016, 17:03
by giaco
thank you, but where is located S_PROCESSIMAGE ?

Re: CAN frame receive and send sms

Posted: Wed 9. Mar 2016, 08:12
by S.Michaelsen
The defintion can be found in typedefs.h

Re: CAN frame receive and send sms

Posted: Thu 17. Mar 2016, 09:37
by giaco
Thank you! I found thanks to you. however, in sms_send function, I put "sms_send (pi.pos.latDeg, sizeof (pi.pos.latDeg), PhoneNumber, LongNumber);"

with PhoneNumber LongNumber and variables that I created. When I wrote the text of sms hard, sends the sms is the way I want. But when I put the variables pi, which sends the sms is white

Re: CAN frame receive and send sms

Posted: Thu 17. Mar 2016, 09:58
by S.Michaelsen
Well, you try to send binary data instead of text. You'd have to convert the values to a text string before you could send it via SMS. For more details about what (special) characters could be send by SMS please have a look into the documentation (e.g. into +CMGS chapter AT_Command_Interface_Guide.pdf).