my ardiuno is sending to my raspberry pi on /dev/ttyAMA0 but cms cannot see it I have some errors in the log but cannot find the file or the problem
here is a log
2017-09-19 11:26:19,136 INFO MainThread EmonHub emonHub emon-pi variant v2.0.0
2017-09-19 11:26:19,138 INFO MainThread Opening hub...
2017-09-19 11:26:19,139 INFO MainThread Logging level set to DEBUG
2017-09-19 11:26:19,141 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx3e'
2017-09-19 11:26:19,187 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-09-19 11:26:19,189 DEBUG MainThread Setting SerialTx3e pubchannels: ['ToEmonCMS']
2017-09-19 11:26:19,221 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2017-09-19 11:26:19,268 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-09-19 11:26:19,285 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2017-09-19 11:26:19,423 INFO MQTT Connecting to MQTT Server
2017-09-19 11:26:19,436 INFO MQTT Could not connect...
2017-09-19 11:26:20,549 INFO MQTT Connecting to MQTT Server
2017-09-19 11:26:20,552 INFO MQTT Could not connect...
2017-09-19 11:26:21,674 INFO MQTT Connecting to MQTT Server
2017-09-19 11:26:21,697 INFO MQTT connection status: Connection successful
2017-09-19 11:26:21,699 DEBUG MQTT CONACK => Return code: 0
2017-09-19 11:26:21,821 INFO MQTT on_subscribe
2017-09-19 11:26:24,661 WARNING SerialTx3e Exception caught in SerialTx3e thread. Traceback (most recent call last):
File "/home/pi/emonhub/src/interfacers/emonhub_interfacer.py", line 38, in wrapper
return f(*args)
File "/home/pi/emonhub/src/interfacers/emonhub_interfacer.py", line 87, in run
rxc = self.read()
File "/home/pi/emonhub/src/interfacers/EmonHubTx3eInterfacer.py", line 96, in read
c.nodeid = int(f[0])
IndexError: list index out of range
here is the config :
#######################################################################
####################### emonhub.conf #########################
#######################################################################
### emonHub configuration file, for info see documentation:
###
#######################################################################
####################### emonHub settings #######################
#######################################################################
[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
####################### Interfacers #######################
#######################################################################
[interfacers]
### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
### This interfacer manages the EmonTx3 ESP format serial
[[SerialTx3e]]
Type = EmonHubTx3eInterfacer
[[[init_settings]]]
# Un-comment line below if using RS485 adapter
#com_port = /dev/ttyRS485-0
# default com port if using USB to UART adapter
com_port= /dev/ttyAMA0
com_baud = 9600
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
group = 210
frequency = 433
baseid = 5 # emonPi / emonBase nodeID
calibration = 230V # (UK/EU: 230V, US: 110V)
quiet = true # Disable quite mode (default enabled) to enable RF packet debugging, show packets which fail crc
# interval = 0 # Interval to transmit time to emonGLCD (seconds)
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = emonpimqtt2016
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
# emonhub/rx/10/values format
# Use with emoncms Nodes module
node_format_enable = 1
node_format_basetopic = emonhub/
# emon/emontx/power1 format - use with Emoncms MQTT input
#
nodevar_format_enable = 1
nodevar_format_basetopic = emon/
[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = 1https://emoncms.org
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1 # Enable sending data to
sendstatus = 1 # Enable sending WAN IP to MyIP > 1https://emoncms.org/myip/list
sendinterval= 30 # Bulk send interval to in seconds
#######################################################################
####################### Nodes #######################
#######################################################################
[nodes]
## See config user guide: 1http://github.com/openenergymonitor/emonhub/blob/master/configuration.md
[[10]]
nodename = emontx1
[[[rx]]]
names = vrms, irms1,irms2, power1, power2
datacode = h
scales = 0.01,0.01,0.01,1,1
units =V,A,A,W,W
i am getting data on that port (checked with minicom)
here is the ardiuno code
// EmonTx V3 Direct Serial example
// AC-AC adapter must be used with this example (highly recomneded for more accurate Real Power calculations)
// Useful for direct connection to Raspberry Pi or computer via USB to UART cable
// Forum thread: 1http://openenergymonitor.org/emon/node/3872
// Tell emonLib this is the emonTx V3
// - don't read Vcc assume Vcc = 3.3V as is always the case on emonTx V3
// - eliminates bandgap error and need for calibration 1http://harizanov.com/2013/09/thoughts-on-avr-adc-accuracy/
#define emonTxV3
// Include Emon Library
#include "EmonLib.h"
// Create four instances
EnergyMonitor ct1, ct2;
unsigned long lastpost = 0;
const byte LEDpin= 6; // emonTx V3 LED
const int nodeID= 10;
void setup()
{
pinMode(LEDpin, OUTPUT);
digitalWrite(LEDpin,HIGH);
Serial.begin(9600);
Serial.println("emonTx V3 Direct serial Example");
// ADC pin, Vcal Calibration, phase_shift
ct1.voltage(0, 111.59, 1.7);
ct2.voltage(0, 111.59, 1.7);
// ct3.voltage(0, 268.97, 1.7);
// ct4.voltage(0, 268.97, 1.7);
// note: UK/EU Vcal = 268.97; USA Vcal = 130.0;
// CT Current calibration
// (2000 turns / 22 Ohm burden resistor = 90.909)
ct1.current(1, 123.45);
ct2.current(2, 123.45);
// ct3.current(3, 90.9);
// CT 4 is high accuracy @ low power - 4.5kW Max
// (2000 turns / 120 Ohm burden resistor = 16.66)
// ct4.current(4, 16.6);
lastpost = 0;
delay(2000);
digitalWrite(LEDpin,LOW);
}
void loop()
{
// A simple timer to fix the post rate to once every 10 seconds
// Please dont post faster than once every 5 seconds to
// Host your own local installation of emoncms for higher resolutions
if ((millis()-lastpost)>=10000)
{
lastpost = millis();
// .calcVI: Calculate all. No.of half wavelengths (crossings), time-out
ct1.calcVI(20,2000);
ct2.calcVI(20,2000);
// ct3.calcVI(20,2000);
// ct4.calcVI(20,2000);
// Print to serial
Serial.print(nodeID); Serial.print(' ');
Serial.println(ct1.Vrms);
Serial.print(ct1.Irms); Serial.print(' ');
Serial.print(ct2.Irms); Serial.print(' ');
Serial.print(ct1.realPower); Serial.print(' ');
Serial.print(ct2.realPower); Serial.print(' ');
digitalWrite(LEDpin,HIGH);
delay(200);
digitalWrite(LEDpin,LOW);
// Note: the following measurements are also available:
// - ct1.apparentPower
// - ct1.Vrms
// - ct1.Irms
}
}
thanks for any help