Make sure to replace "com.your-company:your-product-name" with your ProductUID from Notehub Setup. Also, replace "a-serial-number" with the serial number of other relevant identifier for this particular tracker (e.g. "freight car 2").
This will have the notecard send any outbound messages once per hour. If there are no messages to send, the Notecard does not power on the modem, preserving battery life. It also checks for incoming messages once per day.
This command enables automatic location tracking to Notefile _track.qo.
You can optionally add the property "sync":true which configures the Notecard to perform an immediate sync with Notehub when location is reported. Without this, the Notecard will sync within the next hour.
Detecting whether the car door is open or not can be done using either a Hall Effect sensor and a magnet, or a magnetic door switch.
Which you use in your implementation will depend upon the mounting options available for each type of sensor. All other things being equal, the magnetic door switch is a better choice since it consumes no current while the door is closed. The Hall Effect sensor has a built-in LED which will drain the battery quicker.
The sensor is attached to the Notecarrier using this pinout:
Brown (V+) to VMAIN
Black (Signal) to AUX1
Blue (V-) to GND
You may choose to crimp your own cable ends, or simply splice the wires on the sensor with a Dupont Connector aappropriate for your Notecarrier.
Note that the Hall Effect sensor only detects one pole of the magnet, usually the North pole. Be sure to test your sensor with the magnet by moving the magnet up to the sensor and away, and verify that you see events posted to door.qo in Notehub, confirming that the sensor detected the "open/close" event.
The switch operates like a relay, with COM, Normally Closed and Normally Open terminals. Since the door is closed for most of the time, we only want to sink current through the switch when the door is open to reduce power use.
The door switch is wired to the Notecarrier as follows:
VIO on Notecarrier to the COM terminal on the switch
AUX1 on Notecarrier to the NO terminal on the switch
Once the wiring is complete, test the connection as follows:
bring the two parts of the switch into close proximity
simulate opening and closing the door by moving one part away and then back again to make contact.
You should see events posted to door.qo in Notehub. If you don't, you may need to perform a manual sync by typing sync into the in-browser terminal, or alternatively adding "sync":true to the card.aux command so that the Notecard syncs with Notehub when the door is opened.