Revision: 1.18
CrossFire IX – Freely Programmable - Data Logger Edition -
Programming Manual
2018-12-21
16
with the channel id and API Keys of your channel. You must also modify the ESP8266 example to
connect to a Wi-Fi router that has Internet connection.
For commercial use a ThingSpeak commercial license is needed.
The ThingSpeak example is implemented in the file thingspeak.c.
For more advanced solutions there is also an official ThingSpeak library on
https://github.com/mathworks/thingspeak-arduino
. There are also libraries for MQTT
transmission available.
16.3.
The CAN logger example
This example logs all received CAN messages in the external SPI FLASH memory. It supports both
standard and extended CAN frames. It shows how to read and write to the external FLASH memory
as well as using CAN and RTC. It also shows how to set up a webserver and send large files.
The CAN bus will run at 250 kbit/s. The logger is using a large RX buffer of 1024 messages and will
be able to handle bursts at full bus load. During long time it is not recommended to go above 50%
busload, otherwise messages might be lost. Lost messages will be indicated on the diode. The single
operation that takes the most time is the FLASH erase operation. To erase the complete FLASH
and not allowing wrap around would increase the performance dramatically.
A CAN message will be stored as 24 bytes in the FLASH memory independent on the length of the
message. This makes it easy to find a specific message in the memory but takes more FLASH
memory for small messages. Besides from the actual message data and id, also a 32-bit counter, a
32-bit millisecond timer and a checksum is stored for each message.
The FLASH memory has an endurance of 100000 erase/write cycles. As it takes about 1.5 minutes
to fill the memory at full busload at 250kbit/s (4MB memory), the memory will last for 100000*1.5
minutes = 2500h or 104 days if written continuously at full load.
If the memory gets full, it will wrap around and the oldest messages will be erased.
To perform a firmware upgrade over CAN, digital in 1 (port 9) must be connected to VBAT at start
up. This will active 1000 kbit/s CAN bit rate and the unit will accept firmware upgrade instructions
instead of logging CAN.
When starting the application the CrossFire IX will set up an access point with name
CrossFireIX_001. Connect with password “password001”. The CrossFire IX will use IP address
192.168.4.1 and will give the first connected unit IP address 192.168.4.2.
After running a logging session, it is possible to download the log through the Wi-Fi module to a PC
or mobile device. This is done by using a regular web browser and connecting to the CrossFire IX
web server. From the webpage it is possible to clear the log or download the log to the browser in
.csv format. It is also possible to start and stop logging, get info about number of logged messages
and to set up an acceptance filter defining what range of messages to log. It is also possible to adjust
the RTC clock.
The CAN logger example is implemented in canlogger.c.
For limitations in the CAN logger example, please read the header of the canlogger.c file.