EmonTx4 not showing in Emoncms

Following on from my other post, I am creating this one to focus on emoncms, emonhub, and EmonTx4 integration (via direct USB connection).

I believe my emoncms VM (container actually) is working, but maybe I have missed something. In the main set up page there is no entry for emonhub. I manually configured (in emonhub.conf file) Tx4 as USB device and that seems to be collecting data. But no entries have magically appeared in the INPUT section. The device was configured by the shop for me, so I don’t want to mess up the Tx4 by trying to ‘add’ it if that might overwrite its config.

Server Information

Services
emonhub : Active Running
emoncms_mqtt : Active Running
feedwriter : Active Running - sleep 300s 0 feed points pending write
service-runner : Active Running
redis-server : Active Running
mosquitto : Active Running
demandshaper : Active Running
emonPiLCD : Not found or not installed
Emoncms
Version : low-write 11.3.22
Git :
URL : GitHub - emoncms/emoncms: Web-app for processing, logging and visualising energy, temperature and other environmental data
Branch : * stable
Describe : 11.3.22
Components : Emoncms Core v11.3.22 | App v2.7.4 | Dashboard v2.3.3 | Device v2.2.2 | Graph v2.2.3 | Backup v2.3.2 | DemandShaper v2.2.2 | Postprocess v2.4.7 | Sync v2.1.4 | Usefulscripts v2.3.10 | EmonScripts v1.6.20 | Emonhub v2.5.8

Server
Machine : ASUSTeK COMPUTER INC. MINIPC PN50/PN50, BIOS 0416 08/27/2020
CPU : AMD Ryzen 3 4300U with Radeon Graphics | 1 Threads(s) | 4 Core(s) | 1 Sockets(s) | 5389.92MIPS |
OS : Linux 6.2.16-8-pve
Host : emon-cms | emon-cms.wifi.lan | (192.168.1.19)
Date : 2023-08-24 15:12:49 BST
Uptime : 15:12:49 up 17 min, 1 user, load average: 0.01, 0.04, 0.00

Memory
RAM : Used: 18.99%
Total : 1 GB
Used : 194.43 MB
Free : 829.57 MB
Swap : Used: 0.00%
Total : 512 MB
Used : 0 B
Free : 512 MB

Disk
: - / : Used: 1.73%
Total : 64 GB
Used : 1.11 GB
Free : 62.89 GB
Read Load : n/a
Write Load : n/a
Load Time : n/a

HTTP
Server : Apache/2.4.52 (Ubuntu) HTTP/1.1 CGI/1.1 80

MySQL
Version : 5.5.5-10.6.12-MariaDB-0ubuntu0.22.04.1
Host : 127.0.0.1 (127.0.0.1)
Date : 2023-08-24 15:12:49 (UTC 01:00‌​)
Stats : Uptime: 1060 Threads: 7 Questions: 1301 Slow queries: 0 Opens: 46 Open tables: 39 Queries per second avg: 1.227

Redis
Version :
Redis Server : 6.0.16
PHP Redis : 6.0.0-dev
Host : localhost:6379
Size : 0 keys (995.62K)
Uptime : 0 days

MQTT Server
Version : Mosquitto 2.0.11
Host : localhost:1883 (127.0.0.1)

PHP
Version : 8.1.2-1ubuntu2.14 (Zend Version 4.1.2)
Run user : User: www-data Group: www-data Script Owner: pi
Modules : apache2handler calendar Core ctype curl date dom v20031129exif FFI fileinfo filter ftp gd gettext hash iconv json libxml mbstring mosquitto v0.4.0mysqli mysqlnd vmysqlnd 8.1.2-1ubuntu2.14openssl pcre PDO pdo_mysql Phar posix readline redis v6.0.0-devReflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zlib

Here is /etc/emonhub/emonhub.conf

$ cat /etc/emonhub/emonhub.conf
#######################################################################
#######################      emonhub.conf     #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md
#######################################################################
#######################    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]
### Manually added for the emonTx4 unit
[[USB]]
    Type = EmonHubOEMInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyUSB0
        com_baud = 115200
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        nodename = emonTx4

### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
#[[RFM2Pi]]
#    Type = EmonHubJeeInterfacer
#    [[[init_settings]]]
#        com_port = /dev/ttyAMA0
#        com_baud = 38400                        # 9600 for old RFM12Pi
#    [[[runtimesettings]]]
#        pubchannels = ToEmonCMS,
#        subchannels = ToRFM12,
#
#        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 =  300                         # 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
        # http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
        nodevar_format_enable = 1
        nodevar_format_basetopic = emon/

        # Single JSON payload published  - use with Emoncms MQTT
        node_JSON_enable = 0
        node_JSON_basetopic = emon/

#[[emoncmsorg]]
#    Type = EmonHubEmoncmsHTTPInterfacer
#    [[[init_settings]]]
#    [[[runtimesettings]]]
#        pubchannels = ToRFM12,
#        subchannels = ToEmonCMS,
#        url = https://emoncms.org
#        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#        senddata = 1                    # Enable sending data to Emoncms.org
#        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
#        interval= 30                # Bulk send interval to Emoncms.org in seconds

#######################################################################
#######################          Nodes          #######################
#######################################################################

[nodes]

## See config user guide: https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf

[[5]]
    nodename = emonpi
    [[[rx]]]
        names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
        datacodes = h, h, h, h, h, h, h, h, h, h, L
        scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
        units = W,W,W,V,C,C,C,C,C,C,p

[[6]]
    nodename = emontxshield
    [[[rx]]]
       names = power1, power2, power3, power4, vrms
       datacode = h
       scales = 1,1,1,1,0.01
       units = W,W,W,W,V

[[7]]
   nodename = emontx4
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units = W,W,W,W,V,C,C,C,C,C,C,p

[[8]]
    nodename = emontx3
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[9]]
   nodename = emontx2
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units = W,W,W,W,V,C,C,C,C,C,C,p

[[10]]
    nodename = emontx1
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[11]]
    nodename = 3phase
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[12]]
    nodename = 3phase2
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[13]]
    nodename = 3phase3
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[14]]
    nodename = 3phase4
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[15]]
    nodename = emontx3cm15
    [[[rx]]]
       names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
       scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
       whitening = 1

[[16]]
    nodename = emontx3cm16
    [[[rx]]]
       names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
       scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
       whitening = 1

[[19]]
   nodename = emonth1
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[20]]
   nodename = emonth2
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[21]]
   nodename = emonth3
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[22]]
   nodename = emonth4
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[23]]
    nodename = emonth5
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[24]]
    nodename = emonth6
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[25]]
    nodename = emonth7
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[26]]
    nodename = emonth8
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

Here is a sample from /var/log/emonhub/emonhub.log

2023-08-24 15:21:27,165 DEBUG    USB        Report 160  AC present V1 = 240.33 V2 = 0.00 V3 = 0.00 f=50.31
2023-08-24 15:21:27,367 DEBUG    USB        Ch 1 I=0.048 W=0 VA=12 Wh=0 pf=0.0158
2023-08-24 15:21:27,469 DEBUG    USB        Ch 2 I=0.046 W=0 VA=11 Wh=0 pf=-0.0594
2023-08-24 15:21:27,570 DEBUG    USB        Ch 3 I=0.022 W=0 VA=5 Wh=0 pf=-0.0599
2023-08-24 15:21:27,671 DEBUG    USB        Ch 4 I=0.022 W=0 VA=5 Wh=0 pf=-0.0610
2023-08-24 15:21:27,772 DEBUG    USB        Ch 5 I=0.022 W=0 VA=5 Wh=0 pf=0.0006
2023-08-24 15:21:27,874 DEBUG    USB        Ch 6 I=0.009 W=0 VA=2 Wh=0 pf=-0.0186
2023-08-24 15:21:27,975 DEBUG    USB        Ch 7 I=0.009 W=0 VA=2 Wh=0 pf=-0.0971
2023-08-24 15:21:28,076 DEBUG    USB        Ch 8 I=0.009 W=0 VA=2 Wh=0 pf=-0.0353
2023-08-24 15:21:28,177 DEBUG    USB        Ch 9 I=0.009 W=0 VA=2 Wh=0 pf=-0.0206
2023-08-24 15:21:28,279 DEBUG    USB        Ch 10 I=0.009 W=0 VA=2 Wh=0 pf=0.0002
2023-08-24 15:21:28,380 DEBUG    USB        Ch 11 I=0.009 W=0 VA=2 Wh=0 pf=-0.0608
2023-08-24 15:21:28,482 DEBUG    USB        Ch 12 I=0.009 W=0 VA=2 Wh=0 pf=-0.0897
2023-08-24 15:21:36,323 DEBUG    USB        RF No Ack (1)
2023-08-24 15:21:36,826 DEBUG    USB        RF No Ack (2)
2023-08-24 15:21:36,927 DEBUG    USB        Report 161  AC present V1 = 240.35 V2 = 0.00 V3 = 0.00 f=50.10
2023-08-24 15:21:37,129 DEBUG    USB        Ch 1 I=0.047 W=0 VA=11 Wh=0 pf=0.0140
2023-08-24 15:21:37,230 DEBUG    USB        Ch 2 I=0.046 W=0 VA=11 Wh=0 pf=-0.0712
2023-08-24 15:21:37,331 DEBUG    USB        Ch 3 I=0.022 W=0 VA=5 Wh=0 pf=-0.0501
2023-08-24 15:21:37,433 DEBUG    USB        Ch 4 I=0.022 W=0 VA=5 Wh=0 pf=-0.0620
2023-08-24 15:21:37,534 DEBUG    USB        Ch 5 I=0.021 W=0 VA=5 Wh=0 pf=0.0033
2023-08-24 15:21:37,636 DEBUG    USB        Ch 6 I=0.009 W=0 VA=2 Wh=0 pf=-0.0313
2023-08-24 15:21:37,737 DEBUG    USB        Ch 7 I=0.009 W=0 VA=2 Wh=0 pf=-0.0764
2023-08-24 15:21:37,838 DEBUG    USB        Ch 8 I=0.009 W=0 VA=2 Wh=0 pf=-0.0238
2023-08-24 15:21:37,940 DEBUG    USB        Ch 9 I=0.009 W=0 VA=2 Wh=0 pf=-0.0459
2023-08-24 15:21:38,040 DEBUG    USB        Ch 10 I=0.008 W=0 VA=2 Wh=0 pf=0.0022
2023-08-24 15:21:38,141 DEBUG    USB        Ch 11 I=0.008 W=0 VA=2 Wh=0 pf=-0.0677
2023-08-24 15:21:38,242 DEBUG    USB        Ch 12 I=0.009 W=0 VA=2 Wh=0 pf=-0.0866

Is there a part of the puzzle I’m missing? Thanks!

This is useful, but did you just paste the markdown having clicked on this

image

It should appear on the page like this!

Server Information

Server Information

Services

  • emonhub :- Active Running

  • emoncms_mqtt :- Active Running

  • feedwriter :- Active Running - sleep 300s 425 feed points pending write

  • service-runner :- Active Running

  • emonPiLCD :- Active Running

  • redis-server :- Active Running

  • mosquitto :- Active Running

  • demandshaper :- Not found or not installed

Emoncms

Server

  • CPU :- 1 Threads(s) | 4 Core(s) | 1 Sockets(s) | Cortex-A53 | 89.60MIPS |
  • OS :- Linux 5.15.84-v7+
  • Host :- emonpi | emonpi | (192.168.7.243)
  • Date :- 2023-08-24 15:47:09 BST
  • Uptime :- 15:47:09 up 16 days, 7:30, 0 users, load average: 0.40, 0.49, 0.47

Memory

  • RAM :- Used: 28.79%
    • Total :- 922.14 MB
    • Used :- 265.49 MB
    • Free :- 656.65 MB
  • Swap :- Used: 0.00%
    • Total :- 100 MB
    • Used :- 0 B
    • Free :- 100 MB

Disk

  • **** :- - / :- Used: 42.58%
    • Total :- 5.78 GB
    • Used :- 2.46 GB
    • Free :- 3.01 GB
    • Read Load :- 5.79 B/s
    • Write Load :- 187.87 B/s
    • Load Time :- 6 days 4 hours 11 mins
  • /boot :- Used: 19.54%
    • Total :- 254.99 MB
    • Used :- 49.82 MB
    • Free :- 205.17 MB
    • Read Load :- 0 B/s
    • Write Load :- 0 B/s
    • Load Time :- 6 days 4 hours 11 mins
  • /var/opt/emoncms :- Used: 7.99%
    • Total :- 8.07 GB
    • Used :- 660.17 MB
    • Free :- 7.01 GB
    • Read Load :- 0 B/s
    • Write Load :- 101.46 B/s
    • Load Time :- 6 days 4 hours 11 mins
  • /var/log :- Used: 100.00%
    • Total :- 50 MB
    • Used :- 50 MB
    • Free :- 0 B
    • Read Load :- n/a
    • Write Load :- n/a
    • Load Time :- n/a

HTTP

  • Server :- Apache/2.4.54 (Raspbian) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 10.5.15-MariaDB-0+deb11u1
  • Host :- 127.0.0.1 (127.0.0.1)
  • Date :- 2023-08-24 15:47:09 (UTC 01:00‌​)
  • Stats :- Uptime: 1409448 Threads: 3 Questions: 375941 Slow queries: 0 Opens: 46 Open tables: 39 Queries per second avg: 0.266

Redis

  • Version :-
    • Redis Server :- 6.0.16
    • PHP Redis :- 6.0.0-dev
  • Host :- localhost:6379
  • Size :- 302 keys (804.07K)
  • Uptime :- 16 days

MQTT Server

  • Version :- Mosquitto 2.0.11
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 8.1.15 (Zend Version 4.1.15)
  • Run user :- User: www-data Group: www-data video Script Owner: pi
  • Modules :- apache2handler calendar Core ctype curl date dom v20031129exif FFI fileinfo filter ftp gd gettext hash iconv json libxml mbstring mosquitto v0.4.0mysqli mysqlnd vmysqlnd 8.1.15openssl pcre PDO pdo_mysql Phar posix readline redis v6.0.0-devReflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zlib

Pi

  • Model :- Raspberry Pi 3 Model B+ Rev 1.3 - 1GB (Sony UK)

  • Serial num. :- 71604C19

  • CPU Temperature :- 57.46°C

  • GPU Temperature :- N/A (to show GPU temp execute this command from the console “sudo usermod -G video www-data” )

  • emonpiRelease :- emonSD-10Nov22

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
  • Language :- en-GB,en-US;q=0.9,en;q=0.8

Window

  • Size :- 2069 x 1104

Screen

  • Resolution :- 2560 x 1440

A common error is misunderstanding the pubchannel and subchannel.

No ignore that.

Restart emonhub and see if there is an error message re Mosquitto.

[edit]
Can you access the TX4 to configure it? Configure it to send the data as JSON.

Site is not letting me paste in markdown for some reason, sorry for the formatting.

Restart emonhub, log then shows:

2023-08-24 16:05:53,631 DEBUG    MainThread Signal 15 received.
2023-08-24 16:05:53,667 INFO     MainThread Exiting hub...
2023-08-24 16:05:53,768 INFO     MainThread Exit completed
2023-08-24 16:05:53,971 INFO     MainThread EmonHub v2.5.8
2023-08-24 16:05:53,972 INFO     MainThread Opening hub...
2023-08-24 16:05:53,972 INFO     MainThread Running as user: pi
2023-08-24 16:05:53,972 INFO     MainThread Logging level set to DEBUG
2023-08-24 16:05:53,972 INFO     MainThread Creating EmonHubOEMInterfacer 'USB'
2023-08-24 16:05:53,995 DEBUG    MainThread Opening serial port: /dev/ttyUSB0 @ 115200 bits/s
2023-08-24 16:05:53,995 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2023-08-24 16:05:53,996 DEBUG    MainThread Setting MQTT pubchannels: ['ToRFM12']
2023-08-24 16:05:53,996 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2023-08-24 16:05:53,996 INFO     MainThread Setting MQTT node_format_enable: 1
2023-08-24 16:05:53,996 INFO     MainThread Setting MQTT nodevar_format_enable: 1
2023-08-24 16:05:53,996 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2023-08-24 16:05:53,996 INFO     MainThread Setting MQTT node_JSON_enable: 0
2023-08-24 16:05:53,996 DEBUG    MainThread Automatic configuration of nodes disabled
2023-08-24 16:05:55,604 DEBUG    USB        
EmonTx4 + EmonLibDB Continuous Monitoring Minimal Demo with rf
2023-08-24 16:05:55,806 DEBUG    USB        Starting reports every 9.80 seconds approx.
2023-08-24 16:06:05,853 DEBUG    USB        RF No Ack (1)
2023-08-24 16:06:06,255 DEBUG    USB        RF No Ack (2)
2023-08-24 16:06:06,457 DEBUG    USB        Report 0  AC present V1 = 244.35 V2 = 0.00 V3 = 0.00 f=50.20
2023-08-24 16:06:06,658 DEBUG    USB        Ch 1 I=0.047 W=0 VA=12 Wh=0 pf=0.0153
2023-08-24 16:06:06,759 DEBUG    USB        Ch 2 I=0.045 W=0 VA=11 Wh=0 pf=-0.0625
2023-08-24 16:06:06,861 DEBUG    USB        Ch 3 I=0.022 W=0 VA=5 Wh=0 pf=-0.0276
2023-08-24 16:06:06,962 DEBUG    USB        Ch 4 I=0.021 W=0 VA=5 Wh=0 pf=-0.0599
2023-08-24 16:06:07,063 DEBUG    USB        Ch 5 I=0.022 W=0 VA=5 Wh=0 pf=-0.0021
2023-08-24 16:06:07,164 DEBUG    USB        Ch 6 I=0.009 W=0 VA=2 Wh=0 pf=-0.0134
2023-08-24 16:06:07,266 DEBUG    USB        Ch 7 I=0.009 W=0 VA=2 Wh=0 pf=-0.0755
2023-08-24 16:06:07,367 DEBUG    USB        Ch 8 I=0.009 W=0 VA=2 Wh=0 pf=-0.0340
2023-08-24 16:06:07,469 DEBUG    USB        Ch 9 I=0.010 W=0 VA=2 Wh=0 pf=-0.0096
2023-08-24 16:06:07,570 DEBUG    USB        Ch 10 I=0.008 W=0 VA=2 Wh=0 pf=-0.0024
2023-08-24 16:06:07,672 DEBUG    USB        Ch 11 I=0.009 W=0 VA=2 Wh=0 pf=-0.0749
2023-08-24 16:06:07,773 DEBUG    USB        Ch 12 I=0.009 W=0 VA=2 Wh=0 pf=-0.0765

I do not know how to talk to the EmonTx4 over the tty. I guess I can work on figuring that out if the out-of-the-box setup is not correct. I see from the restart log I just posted MainThread Setting MQTT node_JSON_enable: 0 so maybe that is the problem?

I made a few changes to the emonhub.conf (and restarted it of course) but no effect:

cat /etc/emonhub/emonhub.conf
#######################################################################
#######################      emonhub.conf     #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md
#######################################################################
#######################    emonHub  settings    #######################
#######################################################################

[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
autoconf = 1
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
#######################       Interfacers       #######################
#######################################################################

[interfacers]
### Manually added for the emonTx4 unit
[[USB]]
    Type = EmonHubOEMInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyUSB0
        com_baud = 115200
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        nodename = emonTx4

### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
#[[RFM2Pi]]
#    Type = EmonHubJeeInterfacer
#    [[[init_settings]]]
#        com_port = /dev/ttyAMA0
#        com_baud = 38400                        # 9600 for old RFM12Pi
#    [[[runtimesettings]]]
#        pubchannels = ToEmonCMS,
#        subchannels = ToRFM12,
#
#        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 =  300                         # 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
        # http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
        nodevar_format_enable = 1
        nodevar_format_basetopic = emon/

        # Single JSON payload published  - use with Emoncms MQTT
        node_JSON_enable = 0
        node_JSON_basetopic = emon/

#[[emoncmsorg]]
#    Type = EmonHubEmoncmsHTTPInterfacer
#    [[[init_settings]]]
#    [[[runtimesettings]]]
#        pubchannels = ToRFM12,
#        subchannels = ToEmonCMS,
#        url = https://emoncms.org
#        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#        senddata = 1                    # Enable sending data to Emoncms.org
#        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
#        interval= 30                # Bulk send interval to Emoncms.org in seconds

#######################################################################
#######################          Nodes          #######################
#######################################################################

[nodes]

## See config user guide: https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf

[[5]]
    nodename = emonpi
    [[[rx]]]
        names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
        datacodes = h, h, h, h, h, h, h, h, h, h, L
        scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
        units = W,W,W,V,C,C,C,C,C,C,p

[[6]]
    nodename = emontxshield
    [[[rx]]]
       names = power1, power2, power3, power4, vrms
       datacode = h
       scales = 1,1,1,1,0.01
       units = W,W,W,W,V

[[7]]
   nodename = emontx4
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units = W,W,W,W,V,C,C,C,C,C,C,p

[[8]]
    nodename = emontx3
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[9]]
   nodename = emontx2
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units = W,W,W,W,V,C,C,C,C,C,C,p

[[10]]
    nodename = emontx1
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[11]]
    nodename = 3phase
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[12]]
    nodename = 3phase2
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[13]]
    nodename = 3phase3
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[14]]
    nodename = 3phase4
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

[[15]]
    nodename = emontx3cm15
    [[[rx]]]
       names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
       scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
       whitening = 1

[[16]]
    nodename = emontx3cm16
    [[[rx]]]
       names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
       scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
       whitening = 1

[[17]]
    nodename = emonTx4_17
    [[[rx]]]
        names = MSG, Vrms, P1, P2, P3, P4, P5, P6, E1, E2, E3, E4, E5, E6, T1, T2, T3, pulse
        datacodes = L, h, h, h, h, h, h, h, l, l, l, l, l, l, h, h, h, L
        scales = 1.0, 0.01, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.01, 0.01, 0.01, 1.0
        units = n, V, W, W, W, W, W, W, Wh, Wh, Wh, Wh, Wh, Wh, C, C, C, p

[[19]]
   nodename = emonth1
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[20]]
   nodename = emonth2
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[21]]
   nodename = emonth3
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[22]]
   nodename = emonth4
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[23]]
    nodename = emonth5
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[24]]
    nodename = emonth6
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[25]]
    nodename = emonth7
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[26]]
    nodename = emonth8
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

In emoncms → Admin → serial config

https://docs.openenergymonitor.org/emontx4/configuration.html#using-the-web-tool

You need the command j1 (missing from the docs @TrystanLea) and then s to save the change to eeprom.

You may need this tool to calibrate the CT Ports.

–update, I’m RTFM now on the page you linked Brian, to learn about the serial connection :slight_smile:

Thanks Brian for the suggestion. Makes perfect sense and convenient that the web UI can do this. Unfortunately it did not work. I stopped emonhub and clicked to start serialconfig / serialmonitor and it did not start.

So I tried running the command in my terminal session and got the message that this only works on a Raspberry Pi.

/var/www/emoncms/scripts/serialmonitor$ ./start.sh
Traceback (most recent call last):
  File "/var/www/emoncms/scripts/serialmonitor/serialmonitor.py", line 18, in <module>
    import RPi.GPIO as GPIO
  File "/home/pi/.local/lib/python3.10/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

So a quick google search led me to try:

screen /dev/ttyUSB0 115200,-ixon

which DID connect me.

EmonTx4 + EmonLibDB Continuous Monitoring Minimal Demo with rf
Starting reports every 9.80 seconds approx.

RF No Ack (1)
RF No Ack (2)
Report 0  AC present V1 = 244.45 V2 = 0.00 V3 = 0.00 f=50.25

Ch 1 I=0.047 W=0 VA=12 Wh=0 pf=0.0111
Ch 2 I=0.045 W=0 VA=11 Wh=0 pf=-0.0635
Ch 3 I=0.022 W=0 VA=5 Wh=0 pf=-0.0425
Ch 4 I=0.021 W=0 VA=5 Wh=0 pf=-0.0561
Ch 5 I=0.021 W=0 VA=5 Wh=0 pf=0.0010
Ch 6 I=0.009 W=0 VA=2 Wh=0 pf=-0.0225
Ch 7 I=0.008 W=0 VA=2 Wh=0 pf=-0.0663
Ch 8 I=0.009 W=0 VA=2 Wh=0 pf=-0.0407
Ch 9 I=0.009 W=0 VA=2 Wh=0 pf=-0.0153
Ch 10 I=0.008 W=0 VA=2 Wh=0 pf=-0.0103
Ch 11 I=0.008 W=0 VA=2 Wh=0 pf=-0.0659
Ch 12 I=0.009 W=0 VA=2 Wh=0 pf=-0.0988

I could see the periodic output of the sensor data (as shown above), but I couldn’t type anything. Tried with sudo also. Had to login on another terminal to killall screen to get out of it! haha. Maybe I have to press some arcane key command sequence to get into a mode where I can configure it?

I shall persist.

Good stuff on that page, thanks for reminding me about it: using-the-web-tool

I’ll try to round up the right cables to try the web tool if for some reason connecting to /dev/ttyUSB0 doesn’t let me hit the config page.

@TrystanLea - any reason for needing GPIO?

You might need to power off / power on to get to the config mode @Robert.Wall?

You can simply connect the TX4 directly to a PC and use something like PuTTY.

Ok so the issue is you have installed the Python GPIO module on your system, so it is returning the wrong Error for the catch!

Try changing it to ImportError and see if that works.

I only wrote the library and example sketches, I’ve not yet had time to study in detail how G&T have implemented it in their sketches.

In the ‘old’ emonTx V3 sketch, it required +++[cr][lf] as a “password” to permit changes. Does ?[cr][lf] give some help?
Also - bear in mind the USB C connector on the emonTx4 is orientation-sensitive.

I use the Arduino IDE.

Thanks Brian and Robert. I’m not up on python so it wasn’t clear what to change to ‘ImportError’ – I tried a few things with no change. BUT, if I just comment out that whole little section about the GPIO check there in /var/www/emoncms/scripts/serialmonitor/serialmonitor.py then it does not throw an error, I can see something in the webU (admin/serconfig).

I have 12 CT sensors on mine; it has the add-in extra board. The EmonTx4 Serial Config Tool page shows just 6 CTs, 1-6 all set for 20A. I do see the output of my sensors scroll by every 10 seconds.

I’m a bit afraid to try to send any commands since I have the 12 CTs and the box was pre-configured for them all.

I did try sending the L or l command to list settings but this had no effect. The output just keeps scrolling by every 10 seconds.

It sort of seems like my serial connection is read only from the sensor outputs. I’m just not sure what I’m supposed to see, but I’m not seeing a prompt at all.

I have a support thread open with Glyn, and he said changing it to JSON output would not help my situation. I’ll post the solution if one is found!

According to your post no. 7, you’re using the demo sketch which comes as part of the emonLibDB download. The definitely does not have any on-line calibration built in - its only purpose is to demonstrate how to use the library.
If you want to change the calibration, you need to get the source file, change whatever you need to change, recompile and reload it into the emonTx4. The Arduino IDE (with the appropriate libraries and extension for the Atmel -DB series) will do this.
The serial output was intended only for the human eye, if you need it in an “interfacer” format, then I’m afraid you’ll need to change it to suit the interfacer you will be using (like for calibration - get the source, edit - compile - upload). This is probably the reason for emonHub ignoring it.

I don’t know my way around Github, but the only other sketch I can find there for 12 channels

does not have any code for on-line configuration & calibration either, so IF this is what you have, you need to do the same - get the source file, change whatever you need to change, recompile and reload it into the emonTx4.
But it should print to the serial output (i.e. USB-C) the rms voltage and the 12 powers. For them to show up in emonHub, you need to do whatever emonHub needs to handle the serial input - I’m not up-to-date on the latest Interfacers.
The format of the output from this is
VRMS:234.56,P1:123,P2:234,P3:345,…etc…,P12:1201[cr][lf]

Caveat: This is completely untested.

If you want/need a ‘compatible’ serial output, you need to change (or comment out) the serial output you have in the sketch and substitute something like this:

//  for the EmonHubOEMInterfacer

Serial.print("V1: ");Serial.print(EmonLibDB_getVrms(1));
Serial.print(",V2:");Serial.print(EmonLibDB_getVrms(2));
Serial.print(",V3:");Serial.print(EmonLibDB_getVrms(3));
Serial.print(",f:");Serial.println(EmonLibDB_getLineFrequency());

// then the inside of the 'for' loop

Serial.print(",I");Serial.print(ch);Serial.print(":");Serial.print(EmonLibDB_getIrms(ch),3);,
Serial.print(",P");Serial.print(ch);Serial.print(":");Serial.print(EmonLibDB_getRealPower(ch));
Serial.print(",VA");Serial.print(ch);Serial.print(":");Serial.print(EmonLibDB_getApparentPower(ch));
Serial.print(",E");Serial.print(ch);Serial.print(":");Serial.print(EmonLibDB_getWattHour(ch));
Serial.print(",pf");Serial.print(ch);Serial.print(":");Serial.print(EmonLibDB_getPF(ch),4);
Serial.println();  // <--  this might need moving outside the loop
delay(20);

– always assuming you want/need everything for every channel. I’ve no idea whether emonHub can handle 64 key:value pairs in one go and I’d hazard a guess that nobody has tried before, so there’s every chance it will choke on it.

Ref:

Wow, thanks Robert! You just blew my mind but I think you nailed it. I guess I have more of a project on my hands than I bargained for. Thanks for taking the time to give me those specifics and examples.

Hello @lamixer replying here in reference to your support ticket, as I think the resolution of this might be useful for anyone else troubleshooting as well.

Here’s my understanding of your setup so far:

  1. You have an emonTx4 with the 6CT extender running the EmonTx4 + EmonLibDB Continuous Monitoring Minimal Demo with rf firmware.

  2. You are trying to connect this directly via USB to a local VM running emoncms.

  3. The standard data format of this firmware is not compatible with data over serial/USB.

The solution is to upload a different version of the EmonTx4 firmware that supports single phase 12 CT sensors and prints the output in the right format. This firmware example can be found here: https://github.com/openenergymonitor/emontx4/blob/main/firmware/EmonTx4_DB_12CT_WiFi/EmonTx4_DB_12CT_WiFi.ino

I would recommend following this guide in order to compile and upload the firmware using the Arduino IDE: Firmware — OpenEnergyMonitor 0.0.1 documentation

The EmonTx4_DB_12CT_WiFi firmware mentions WiFi in it’s name, the intention behind this firmware was to provide support for the EmonTx4 with 12 CT sensors when connected to an EmonESP WiFi board. This firmware is also suitable for your direct USB connection as the serial output format is the same.

I would also check the CT sensor calibration values while you are at it, see lines 127-141 https://github.com/openenergymonitor/emontx4/blob/main/firmware/EmonTx4_DB_12CT_WiFi/EmonTx4_DB_12CT_WiFi.ino#L127 the example is configured for 20A CT sensors on all channels.

1 Like

Hello. I’m getting close. I’m on a MacOS machine, have set up Visual Studio Code with the PlatformIO add-on installed. Cloned the github repo for emontx4 and attempt to compile emontx4 > firmware > EmonTx4_DB_12CT_Wifi by opening that folder.

Of course, it asks for a platformio.ini file.

Instructions elsewhere said the contents of this platformio.ini file should be the following:

[platformio]
default_envs = default
src_dir = .

[env]
platform = atmelmegaavr
framework = arduino
board = AVR128DB48
platform_packages =             ; Compiles without this set?
  ; DxCore AVD-DB
  platformio/framework-arduino-megaavr-dxcore@^1.5.6
  
board_build.f_cpu = 24000000L   ; 24 MHz
# board_hardware.oscillator = external

board_hardware.uart = uart3     ; May not be required? 
monitor_speed = 115200

lib_deps =
  https://github.com/SpenceKonde/OneWire.git#36e2604
  https://github.com/openenergymonitor/RFM69_LPL.git#909b91d
  https://github.com/openenergymonitor/emonEProm#avrdb
  https://github.com/openenergymonitor/EmonLibCM#avrdb

[env:default]
build_flags = -DUSING_OPTIBOOT  ; Upload via uart
upload_protocol = arduino
upload_speed = 115200
upload_flags = -v               ; Verbose


However, I wonder if that is not entirely correct when trying to use the DB type of firmware required by my board (12CT). I actually was able to build the standard 6CT version, as a test. lib_deps needs more items listed?

If I just forge ahead and try to compile the firmware I need, it will show error that emonLibDB.h is not available. I actually solved that by downloading it from Roberts page and copying it in to the root of this folder I’m working from.

Trying again, now I’m missing EEPROM.h and SPI.h and there’s a reference to emonLibCM also. I locate those files on github, copy to my directory, and give another go.

Generally, still not working. Obviously I have no idea what I’m doing.

I’ll keep trying, but any help would be appreciated (besides, ‘take a programming class’ though that would of course help).

lightly sanitized last run output:

Executing task: platformio run 

Processing default (platform: atmelmegaavr; framework: arduino; board: AVR128DB48)
-------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelmegaavr/AVR128DB48.html
PLATFORM: Atmel megaAVR (1.9.0) > AVR128DB48
HARDWARE: AVR128DB48 24MHz, 16KB RAM, 128KB Flash
PACKAGES: 
 - framework-arduino-megaavr-dxcore @ 1.5.6 
 - toolchain-atmelavr @ 3.70300.220127 (7.3.0)
Converting EmonTx4_DB_12CT_WiFi_TSMod1.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 22 compatible libraries
Scanning dependencies...
Dependency Graph
|-- OneWire @ 2.3.5+sha.36e2604
|-- RFM69_LPL @ 0.0.0+20231004115937.sha.909b91d
|-- emonEProm @ 1.0.0+sha.b0859d6
|-- EmonLibCM @ 3.0.6+sha.90a4135
Building in release mode
Compiling .pio/build/default/src/EmonTx4_DB_12CT_WiFi_TSMod1.ino.cpp.o
Compiling .pio/build/default/lib710/OneWire/OneWire.cpp.o
Compiling .pio/build/default/libc15/RFM69_LPL/RFM69_LPL.cpp.o
Compiling .pio/build/default/lib4d4/emonEProm/emonEProm.cpp.o
Compiling .pio/build/default/libce6/EmonLibCM/emonLibCM.cpp.o
Compiling .pio/build/default/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART0.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART1.cpp.o
.pio/libdeps/default/emonEProm/emonEProm.cpp:12:10: fatal error: EEPROM.h: No such file or directory

****************************************************************
* Looking for EEPROM.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:EEPROM.h"
* Web  > https://registry.platformio.org/search?q=header:EEPROM.h
*
****************************************************************

 #include <EEPROM.h>
          ^~~~~~~~~~
compilation terminated.
Compiling .pio/build/default/FrameworkArduino/UART2.cpp.o
In file included from .pio/libdeps/default/EmonLibCM/emonLibCM.cpp:76:0:
.pio/libdeps/default/EmonLibCM/emonLibCM.h:63:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

 #include <SPI.h>
          ^~~~~~~
compilation terminated.
Compiling .pio/build/default/FrameworkArduino/UART3.cpp.o
*** [.pio/build/default/lib4d4/emonEProm/emonEProm.cpp.o] Error 1
*** [.pio/build/default/libce6/EmonLibCM/emonLibCM.cpp.o] Error 1
Compiling .pio/build/default/FrameworkArduino/UART4.cpp.o
================================================= [FAILED] Took 0.47 seconds =================================================

Ah… I needed a little break. I re-read this part “Next install the libraries used by the main firmware, download and place these in your Arduino libraries directory” of the instructions and now I know what that means and will try using those links and update. But it’s lunch time now.

You don’t need that if you’re using emonLibDB. The two perform the same job, getting the power/energy data. But they can co-exist, there’s no need to remove one to use the other.

I’m afraid I can’t help if you feel the need to use platfromio. All the development work on emonLibDB was done with the Arduino IDE.

Ok, maybe I’ll switch. Does the Arduino IDE have to run on an Arduino board?

Here’s my attempt with the ‘correct’ xyz.h files:

 *  Executing task: platformio run 

Processing default (platform: atmelmegaavr; framework: arduino; board: AVR128DB48)
-------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelmegaavr/AVR128DB48.html
PLATFORM: Atmel megaAVR (1.9.0) > AVR128DB48
HARDWARE: AVR128DB48 24MHz, 16KB RAM, 128KB Flash
PACKAGES: 
 - framework-arduino-megaavr-dxcore @ 1.5.6 
 - toolchain-atmelavr @ 3.70300.220127 (7.3.0)
Converting EmonTx4_DB_12CT_WiFi_TSMod1.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 22 compatible libraries
Scanning dependencies...
Dependency Graph
|-- OneWire @ 2.3.5+sha.36e2604
|-- RFM69_LPL @ 0.0.0+20231004115937.sha.909b91d
|-- emonEProm @ 1.0.0+sha.b0859d6
|-- EmonLibCM @ 3.0.6+sha.90a4135
Building in release mode
Compiling .pio/build/default/src/EmonTx4_DB_12CT_WiFi_TSMod1.ino.cpp.o
Compiling .pio/build/default/liba6e/OneWire/OneWire.cpp.o
Compiling .pio/build/default/libcfe/RFM69_LPL/RFM69_LPL.cpp.o
Compiling .pio/build/default/lib985/emonEProm/emonEProm.cpp.o
Compiling .pio/build/default/libb20/EmonLibCM/emonLibCM.cpp.o
Compiling .pio/build/default/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART0.cpp.o
Compiling .pio/build/default/FrameworkArduino/UART1.cpp.o
.pio/libdeps/default/emonEProm/emonEProm.cpp:12:10: fatal error: EEPROM.h: No such file or directory

****************************************************************
* Looking for EEPROM.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:EEPROM.h"
* Web  > https://registry.platformio.org/search?q=header:EEPROM.h
*
****************************************************************

 #include <EEPROM.h>
          ^~~~~~~~~~
compilation terminated.
Compiling .pio/build/default/FrameworkArduino/UART2.cpp.o
In file included from .pio/libdeps/default/EmonLibCM/emonLibCM.cpp:76:0:
.pio/libdeps/default/EmonLibCM/emonLibCM.h:63:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

 #include <SPI.h>
          ^~~~~~~
compilation terminated.
Compiling .pio/build/default/FrameworkArduino/UART3.cpp.o
*** [.pio/build/default/lib985/emonEProm/emonEProm.cpp.o] Error 1
*** [.pio/build/default/libb20/EmonLibCM/emonLibCM.cpp.o] Error 1
Compiling .pio/build/default/FrameworkArduino/UART4.cpp.o
========================================================== [FAILED] Took 0.47 seconds ==========================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.