background image

 

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. 

Содержание CrossFire IX

Страница 1: ...Revision 1 18 CrossFire IX Freely Programmable Data Logger Edition Programming Manual 2018 12 21 www crosscontrol com CrossFire IX Freely Programmable Data Logger Edition Programming Manual...

Страница 2: ...ossFire IX Data Logger API 7 11 Interrupts 7 12 Hardware resources 8 13 Testing 8 14 Tools 8 14 1 Upgrading the firmware of the CrossFire IX over Wi Fi 8 15 Functionality of the Data Logger Edition 10...

Страница 3: ...1 6 Added info about the examples CMM 2018 11 07 1 7 Minor changes regarding the Wi Fi module CMM 2018 11 09 1 8 Updated examples chapter CMM 2018 11 20 1 9 Name change to Programming Manual CMM 2018...

Страница 4: ...machine is used during special supervision Especially if the firmware written allows messages coming over Wi Fi to control outputs or to send CAN messages However note that even if outputs or CAN is...

Страница 5: ...ed Workbench For programming the Wi Fi slave processor several development environments are available The development environment recommended by CrossControl is the Arduino IDE The Arduino IDE can be...

Страница 6: ...ed in the Boards Manager In the menu under Tools Board make sure to select the NodeMCU 0 9 this is not exactly right but close enough To create a binary for CrossFire IX select Sketch Export compiled...

Страница 7: ...sion of the CrossFire IX Tool supporting upgrade of the Wi Fi processor The tool is available in the Tools CrossFire IX Tool DLE folder 9 Libraries To make it possible to use the data logger functions...

Страница 8: ...ST the function PerformUnitTest will be executed after system init In this function a number of test functions are called The test functions will use printf to give user feedback so it is important th...

Страница 9: ...Fi processor NodeMCU For the Wi Fi processor file you need to supply your own version number For the other binaries the version number is read from the binary file itself When all files are selected...

Страница 10: ...optional Erase the SPI FLASH used by FOTA the first 1 5MB by clicking Erase FLASH This will erase any information that is stored there already Browse for the fwp file by pressing the button Click Down...

Страница 11: ...possible to erase the complete FLASH at once Please note that writing to and erasing the external FLASH memory is a relatively slow operation Writing to the FLASH memory requires the memory to be eras...

Страница 12: ...d data to an IoT cloud service like ThingSpeak Set up a local webserver that can be used for administering or supervising the CrossFire IX Fetch data from internal or external web servers for instance...

Страница 13: ...should not be freed with WIFI_FreeLastMessage afterwards void WIFI_FreeLastMessage void Free the last message in the message queue Must be called after you have processed data returned by WIFI_GetMes...

Страница 14: ...hat IP address and port is correct To perform a firmware upgrade over CAN digital in 1 must be connected to VBAT at start up This will active 1000 kbit s CAN bit rate and the unit will accept firmware...

Страница 15: ...commercial use ThingSpeak is integrated with MATLAB making it possible to perform advanced data analysis The ThingSpeak example shows how to send data to the ThingSpeak IoT server The example sets up...

Страница 16: ...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 mess...

Страница 17: ...is used for other things as well you must reserve the first 1 5MB if FOTA is going to be used When starting the example the CrossFire IX will set up an access point with name CrossFireIX_001 Use passw...

Страница 18: ...gramming Manual 2018 12 21 18 https support crosscontrol com https atollic com https www arduino cc en Main Software https www espressif com en products hardware esp wroom 02 overview https thingspeak...

Страница 19: ...in this handbook is supplied without any guarantees and can change without prior notification For CrossControl licensed software CrossControl grants you a license to under CrossControl intellectual p...

Отзывы: