Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrections to serial-direct example #31

Merged
merged 1 commit into from Apr 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 18 additions & 8 deletions conf/interfacer_examples/directserial/readme.md
Expand Up @@ -11,11 +11,11 @@ Here is an example of printing data from an Arduino sketch:

```
Serial.print(nodeID); Serial.print(' ');
Serial.print((int)(realPower1)); Serial.print(' '); // These for compatibility, but whatever you need if emonHub is configured to suit.
Serial.print((int)(realPower2)); Serial.print(' ');
Serial.print((int)(realPower3)); Serial.print(' ');
Serial.print((int)(realPower4)); Serial.print(' ');
Serial.print((int)(Vrms*100));
Serial.print(realPower1); Serial.print(' ');
Serial.print(realPower2); Serial.print(' ');
Serial.print(realPower3); Serial.print(' ');
Serial.print(realPower4); Serial.print(' ');
Serial.print(Vrms); Serial.println();
```

## Example emonhub Config
Expand All @@ -26,12 +26,22 @@ In the `[interfacers]` section:
[[SerialDirect]]
Type = EmonHubSerialInterfacer
[[[init_settings]]]
com_port = /dev/ttyUSB0
com_baud = 9600
com_port = /dev/ttyUSB0 # or /dev/ttyAMA0 or/dev/ttyACM0 etc
com_baud = 9600 # to match the baud of the connected device
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
```
In the `[nodes]` section:

```
[[99]]
nodename = my-serial-device
[[[rx]]]
names = power1, power2, power3, power4, vrms
datacode = 0 # not essential as "0" is default datacode for serial interfacer
scale = 1 # not essential as "1" is default scale for serial interfacer
units =W,W,W,W,V
```
## Debugging

- Ensure the data received on the serial port is 100% numerical characters with no rogue spaces. Non-numerical characters could result in `Thread is dead` error.
- Ensure the data received on the serial port is 100% numerical characters with no rogue spaces. Non-numerical characters could result in `Thread is dead` error.