
Changes settings of the CAN (Controller Area Network) Interface. Settings are stored in NVRAM and are effective after next reboot.
CAN has 5 required and one optional argument:
ERR_OK (0) if command is accepted
ERR_ARGUMENT (4) if one or more arguments are wrong
ERR_PARAMCOUNT (3) if number of arguments is not 5
CAN 125000 1fe 0 2ff 1
Sets the CAN interface to 125,000 bits per second.
... and the Message ID where the module listens to the Standard Message ID 0x1fe
....and the Message ID that the module uses for transmissions to the Extended Message ID 0x2ff
To enable flow control set the sixth argument to ON. In this mode, the Avisaro Module sends CAN frames with a single data byte XOFF (19) if its input buffer is nearly full. When input buffer space becomes sufficient again, the module sends frames containing a single XON (17) data byte. This is similar to RS232 software flow control. To switch off proprietary flow control, set the sixth argument to OFF and reboot the module.
This command enables or disables logging of special event messages. If ERRLOG in ON, events like bus errors, error warnings, overruns and so on are also stored (beside regular frames) into the receive FIFO.
Requires Firmware Version 4.39 or higher.
If error logging is enabled, e.g. with CAN ERRLOG ON, certain events from the internal CAN controller circuit cause extra, synthetical frames, to bestored in the receive FIFO. Those frames can be read like regular frames, but to distinguish regular frames from extra frames, the CAN-ID must be checked. All extra frames have an ID of 0xffffffff (or -1 in signed integer format), that is much bigger than any valid regular ID. All extra frames also have an identifier that is the first byte of the 8-bytes payload field. The other members of the payload field hold additional information
The following list shows all possible extra frame IDs, which can be found in the first byte of the CAN payload field:
The second byte of the CAN payload field contains the bit position where, in case of a bus error, the error happens. Here's a list of values and their meanings. A bus error occured ...
The third byte of the CAN payload field contains the direction, that means, RX or TX of the bus error. These two values are possible:
1. Error while receiving
The fourth byte of the CAN payload field contains the type of bus error that recently happened, This can be:
3. Other Error
The fifth byte of the CAN payload field contains the bit position from beginning of the frame, when the CAN controller loses bus arbitration. Possible values are:
31 Arbitration lost in RTR bit of extended frame.
The sixth byte contains the current RX error counter.
The seventh byte contains the current TX error counter.
Every extra frame also has valid timestamps, just like regular frames. All members not mnetioned here are not used and filled with zeros.
With the CAN? command one can query the actual CAN settings including that concerned to filtering, special modes and handling of external tarnsceiver chips. A single line containing all information (9, 11 or 12 separated by spaces is submitted to the active I/O interface.
The 9th and 11th value are not available prior to firmware version 3.52
The 12th value only exists on version 4.39 and above
As an example, such a line might look like this:
125000 49 STD 49 STD 3 6 OPEN OFF NORMAL OFF NORMAL
The meaning of all fields from left to right is: