Deleted an Input - how do I get it back

Trying to work through an issue I’m having with no data being recorded and I was trying various things. Unfortunately, I deleted the power1, power2 and power1+power2 inputs and I can’t seem to figure out how to get them back. Anyone know or do I have to rebuild the image from scratch?

EDIT:

Even better. I found the factoryreset command and ran it. But now there are no inputs whatsoever.

UPDATE:

Downloaded the latest image. Installed it. Turned on the device. Registered and logged in to web page… and still no inputs!

Inputs will return when they are posted. It they are not returning then maybe there could be an issue with emonHub. I’m guessing you are running an emonPi

Could you post the contents of emonhub.log? See Setup > EmonHub in local Emoncms.

Was the system working previously?

The log is below. Was it working before? Yes and no. The inputs were there and I could add feeds but no data ever actually appeared. The values always read as “NaN” or “null.” I’ve tried updating. That caused some issues. After updating, for example, the next “sudo apt-get update” would freeze at around 45%.

I’ve tried lots of fiddling. Eventually I downloaded the latest image (same image that it came with) and rewrote the memory card. Now no inputs are listed at all.

Log:

2017-04-16 20:39:59,377 INFO     MQTT       connection status: Connection successful
2017-04-16 20:39:59,379 DEBUG    MQTT       CONACK => Return code: 0
2017-04-16 20:39:59,480 INFO     MQTT       on_subscribe
2017-04-16 20:56:03,563 DEBUG    MainThread SIGINT received.
2017-04-16 20:56:03,564 INFO     MainThread Exiting hub...
2017-04-16 20:56:03,662 INFO     MainThread Exit completed
2017-04-16 20:56:56,748 INFO     MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-04-16 20:56:56,749 INFO     MainThread Opening hub...
2017-04-16 20:56:56,750 INFO     MainThread Logging level set to DEBUG
2017-04-16 20:56:56,750 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2017-04-16 20:56:56,753 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2017-04-16 20:56:58,756 WARNING  MainThread Device communication error - check settings
2017-04-16 20:56:58,758 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2017-04-16 20:56:59,760 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2017-04-16 20:57:00,762 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2017-04-16 20:57:01,764 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2017-04-16 20:57:02,766 INFO     MainThread Setting RFM2Pi calibration: 230V (1p)
2017-04-16 20:57:03,769 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-04-16 20:57:03,770 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-16 20:57:03,771 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-04-16 20:57:03,771 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-16 20:57:03,773 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2017-04-16 20:57:03,774 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-04-16 20:57:03,777 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-04-16 20:57:03,778 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2017-04-16 20:57:03,780 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-04-16 20:57:03,878 INFO     MQTT       Connecting to MQTT Server
2017-04-16 20:57:03,881 INFO     MQTT       connection status: Connection successful
2017-04-16 20:57:03,882 DEBUG    MQTT       CONACK => Return code: 0
2017-04-16 20:57:03,984 INFO     MQTT       on_subscribe

UPDATE:

I did an update from the web interface and now the log is different:

Log:

2017-04-16 20:50:22,857 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2017-04-16 20:50:24,861 WARNING  MainThread Device communication error - check settings
2017-04-16 20:50:24,862 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2017-04-16 20:50:25,864 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2017-04-16 20:50:26,866 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2017-04-16 20:50:27,869 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2017-04-16 20:50:29,491 INFO     MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-04-16 20:50:29,492 INFO     MainThread Opening hub...
2017-04-16 20:50:29,493 INFO     MainThread Logging level set to DEBUG
2017-04-16 20:50:29,494 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2017-04-16 20:50:29,497 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2017-04-16 20:50:31,500 WARNING  MainThread Device communication error - check settings
2017-04-16 20:50:31,501 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2017-04-16 20:50:32,503 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2017-04-16 20:50:33,505 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2017-04-16 20:50:34,507 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2017-04-16 20:50:35,510 INFO     MainThread Setting RFM2Pi calibration: 230V (1p)
2017-04-16 20:50:36,512 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-04-16 20:50:36,513 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-16 20:50:36,514 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-04-16 20:50:36,515 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-16 20:50:36,516 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2017-04-16 20:50:36,517 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-04-16 20:50:36,520 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-04-16 20:50:36,521 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2017-04-16 20:50:36,523 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-04-16 20:50:36,621 INFO     MQTT       Connecting to MQTT Server
2017-04-16 20:50:36,624 INFO     MQTT       connection status: Connection successful
2017-04-16 20:50:36,625 DEBUG    MQTT       CONACK => Return code: 0
2017-04-16 20:50:36,727 INFO     MQTT       on_subscribe

Try setting com_baud = 115200 in the [[RFM2Pi]] settings in emonhub.conf if you are using an emonPi (although you didn’t answer Glyn’s question your other thread is about an emonPi so I assume this is the same device)

Doh! I missed that question. This is definitely an emonpi. I changed the baud rate as you suggested and rebooted. EmonHub log file follows below. I still get ERROR: MQTT Not coneected.

emonhub.log:

2017-04-17 20:57:05,841 WARNING  MainThread Device communication error - check settings
2017-04-17 20:57:05,842 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2017-04-17 20:57:06,844 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2017-04-17 20:57:07,847 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2017-04-17 20:57:08,849 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2017-04-17 20:57:09,851 INFO     MainThread Setting RFM2Pi calibration: 110V (2p)
2017-04-17 20:57:10,854 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-04-17 20:57:10,855 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-17 20:57:10,856 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-04-17 20:57:10,857 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-17 20:57:10,861 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2017-04-17 20:57:10,863 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-04-17 20:57:10,869 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-04-17 20:57:10,871 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2017-04-17 20:57:10,878 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-04-17 20:57:10,972 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:10,973 INFO     MQTT       Could not connect...
2017-04-17 20:57:12,076 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:12,077 INFO     MQTT       Could not connect...
2017-04-17 20:57:13,179 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:13,182 INFO     MQTT       Could not connect...
2017-04-17 20:57:14,284 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:14,286 INFO     MQTT       Could not connect...
2017-04-17 20:57:15,388 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:15,390 INFO     MQTT       Could not connect...
2017-04-17 20:57:16,492 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:16,596 INFO     MQTT       Connecting to MQTT Server
2017-04-17 20:57:16,599 INFO     MQTT       connection status: Connection successful
2017-04-17 20:57:16,601 DEBUG    MQTT       CONACK => Return code: 0
2017-04-17 20:57:16,703 INFO     MQTT       on_subscribe

EDIT: Just to be clear I only have the emonpi unit. The only sensors are two of the current sensors. If I restart emonhub I seem to get a little more information:

2017-04-17 21:09:51,652 INFO     MQTT       connection status: Connection successful
2017-04-17 21:09:51,654 DEBUG    MQTT       CONACK => Return code: 0
2017-04-17 21:09:51,756 INFO     MQTT       on_subscribe
2017-04-17 21:11:28,014 DEBUG    MainThread SIGINT received.
2017-04-17 21:11:28,015 INFO     MainThread Exiting hub...
2017-04-17 21:11:28,205 INFO     MainThread Exit completed
2017-04-17 21:11:29,317 INFO     MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-04-17 21:11:29,318 INFO     MainThread Opening hub...
2017-04-17 21:11:29,318 INFO     MainThread Logging level set to DEBUG
2017-04-17 21:11:29,319 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2017-04-17 21:11:29,322 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2017-04-17 21:11:31,325 WARNING  MainThread Device communication error - check settings
2017-04-17 21:11:31,326 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2017-04-17 21:11:32,329 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2017-04-17 21:11:33,331 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2017-04-17 21:11:34,333 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2017-04-17 21:11:35,335 INFO     MainThread Setting RFM2Pi calibration: 110V (2p)
2017-04-17 21:11:36,338 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-04-17 21:11:36,339 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-17 21:11:36,339 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-04-17 21:11:36,340 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-04-17 21:11:36,342 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2017-04-17 21:11:36,343 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-04-17 21:11:36,345 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-04-17 21:11:36,347 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2017-04-17 21:11:36,349 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-04-17 21:11:36,447 INFO     MQTT       Connecting to MQTT Server
2017-04-17 21:11:36,450 INFO     MQTT       connection status: Connection successful
2017-04-17 21:11:36,451 DEBUG    MQTT       CONACK => Return code: 0
2017-04-17 21:11:36,553 INFO     MQTT       on_subscribe

Here you can see it attempted to connect with the 115200 baud rate.

The emonPi still uses 38400 baud rate:

https://github.com/openenergymonitor/emonpi/blob/master/firmware/src/src.ino#L79

@PFrost sorry for the confusion, please try and change the baud rate back to 38400. The issue seems to be that the emonPi does not seem to be posting any data.

Could you try and open up a direct serial connection to emonPi, i’m assuming you are familiar.

First stop emonhub

$ sudo service emonhub stop

then open up a serial connection to emonPi

$ sudo minicom -D /dev/ttyAMA0 -b 38400

Once in minicom, try and transmit the character v via serial (just hit ‘v’), this should get the emonPi tor return the FW version and it’s settings. If you don’t see anything then the fault must be with the emonPi.

To exit minicom ctrl + a then x

Could you post the emonpi update log file? $ cat ~/data/emonpiupdate.log

Whoops! My bad, I must have been thinking “emonTx” and wishful thinking it was just a setting.

2017-04-16 20:50:29,494 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2017-04-16 20:50:29,497 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2017-04-16 20:50:31,500 WARNING  MainThread Device communication error - check settings

emonpiupdate.log shown at the bottom.

Hitting ‘v’ in minicom produced no response whatsoever.

I2C LCD DETECTED Ox3f
Starting emonPi Update >
via service-runner-update.sh
EUID: 1000
Argument: emonpi
Tue 18 Apr 18:35:21 EDT 2017
git pull /home/pi/emonpi
* master
  wifiap
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
        1
        hardware/emonpi/emonpi2c/
        lcd/gsmhuaweistatus.pyc
        lcd/i2c_lib.pyc
nothing added to commit but untracked files present (use "git add" to track)
Updating 1481242..2b0fad3
Fast-forward
 .gitignore    |  3 ++-
 emoncmsupdate | 39 +++++++++++++++++++++++++++++++++++++++
 md5sum.py     | 24 ++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100755 md5sum.py
git pull /home/pi/RFM2Pi
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Already up-to-date.
git pull /home/pi/emonhub
  K0den-wibeee_interface
* emon-pi
  hmm01i-syslogging
On branch emon-pi
Your branch is up-to-date with 'origin/emon-pi'.
nothing to commit, working directory clean
Already up-to-date.
git pull /home/pi/oem_openHab
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Already up-to-date.
git pull /home/pi/usefulscripts
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
git pull /home/pi/huawei-hilink-status
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Start emonPi Atmega328 firmware update:
=================================
EmonPi update started
=================================
EUID: 1000
Requirement already up-to-date: paho-mqtt in /usr/local/lib/python2.7/dist-packages
Stopping OpenEnergyMonitor emonHub: emonhub has been stopped ok.
Start ATmega328 serial upload using avrdude with latest.hex
Discrete Sampling
avrdude -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:/home/pi/emonpi/firmware/compiled/latest.hex
avrdude-original: Using autoreset DTR on GPIO Pin 7
Starting OpenEnergyMonitor emonHub: emonhub has been started ok.
Start emonhub update script:
=================================
EmonPi update started
=================================
Running emonhub automatic node addition script
EUID: 1000
EUID: 1000
[[5]]
Node 5 already present
[[6]]
Node 6 already present
[[7]]
Node 7 already present
[[8]]
Node 8 already present
[[9]]
Node 9 already present
[[10]]
Node 10 already present
[[11]]
Node 11 already present
[[19]]
Node 19 already present
[[20]]
Node 20 already present
[[21]]
Node 21 already present
[[22]]
Node 22 already present
[[23]]
Node 23 already present
[[24]]
Node 24 already present
[[25]]
Node 25 already present
[[26]]
Node 26 already present
Start emoncms update:
=================================
Emoncms update started
Tue 18 Apr 18:36:26 EDT 2017
EUID: 1000
Checking cron tab for service runner entry...
service runner crontab entry already installed
current settings.php md5: 6922362a0a23fa0918bcc91b1fcf1ca3
Default settings.php md5: 6922362a0a23fa0918bcc91b1fcf1ca3
git pull /var/www/emoncms
  dev-mosquitto-php
  master
* stable
  symlinked_modules
On branch stable
Your branch is up-to-date with 'origin/stable'.
nothing to commit, working directory clean
Updating 22c0ae9..1044bec
Fast-forward
 .travis.yml                               |   1 -
 Lib/tablejs/COPYRIGHT.txt                 |   5 +-
 Lib/tablejs/custom-table-fields.js        |  99 ++++++-----
 Lib/tablejs/expandtables.html             |  91 ++++++++++
 Lib/tablejs/table.js                      | 277 ++++++++++++++++++++----------
 Modules/eventp/eventp_processlist.php     |  10 +-
 Modules/feed/Views/feedapi_view.php       |   9 +-
 Modules/feed/Views/feedlist_view.php      |  44 +++--
 Modules/feed/engine/PHPFina.php           |   3 +-
 Modules/feed/engine/VirtualFeed.php       |  13 +-
 Modules/feed/feed_controller.php          |   4 +-
 Modules/feed/feed_model.php               |  21 ++-
 Modules/input/Views/input_api.php         |   1 +
 Modules/input/Views/input_dialog.js       |  33 ++++
 Modules/input/Views/input_dialog.php      |  24 +++
 Modules/input/Views/input_view.php        | 185 +++++++++-----------
 Modules/input/input_controller.php        |  94 ++++++----
 Modules/process/Views/process_ui.js       | 113 ++++++++----
 Modules/process/process_model.php         |  36 +++-
 Modules/process/process_processlist.php   | 105 +++++------
 Modules/schedule/Views/schedule_view.php  |  31 ++--
 Modules/schedule/schedule_processlist.php |   8 +-
 Modules/vis/vis_controller.php            |   4 +-
 Theme/basic/ajax-loader.gif               | Bin 0 -> 4663 bytes
 Theme/basic/emon.css                      |  10 ++
 Theme/basic/theme.php                     |   4 +-
 core.php                                  |   2 +-
 default.emonpi.settings.php               |   5 +-
 default.settings.php                      |   5 +-
 docs/LinuxInstall.md                      |   2 +-
 docs/RaspberryPi/readme.md                |   4 +-
 index.php                                 |   2 +-
 process_settings.php                      |  86 +++++-----
 readme.md                                 |  89 ++++++++--
 34 files changed, 931 insertions(+), 489 deletions(-)
 create mode 100644 Lib/tablejs/expandtables.html
 create mode 100644 Modules/input/Views/input_dialog.js
 create mode 100644 Modules/input/Views/input_dialog.php
 create mode 100644 Theme/basic/ajax-loader.gif
NEW default settings.php md5: 38c3d9bbef6a003cbed97e87b1a723f3
settings.php had NOT been user modifed
Update required to settings.php...
settings.php autoupdated
git pull /var/www/emoncms/Modules/app
* 9.0
On branch 9.0
Your branch is up-to-date with 'origin/9.0'.
nothing to commit, working directory clean
Already up-to-date.
git pull /var/www/emoncms/Modules/config
* 9.0
On branch 9.0
Your branch is up-to-date with 'origin/9.0'.
nothing to commit, working directory clean
Already up-to-date.
git pull /var/www/emoncms/Modules/wifi
* 9.0
On branch 9.0
Your branch is up-to-date with 'origin/9.0'.
nothing to commit, working directory clean
Already up-to-date.
git pull /var/www/emoncms/Modules/dashboard
  environ-master
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Already up-to-date.
git pull /var/www/emoncms/Modules/graph
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Already up-to-date.
git pull /home/pi/postprocess
Your branch is up-to-date with 'remotes/origin/emonpi'.
Already up-to-date.
git pull /home/pi/backup
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Already up-to-date.
update mqtt_input systemd unit file
Update Emoncms database
[]
Restarting Services...
Restarting OpenEnergyMonitor emonHub: emonhub has been restarted ok.
Log is turned off
Restarting feedwriter
Restarting openhab (via systemctl): openhab.service.
set log rotate config owner to root
Restarting Services...
Starting emonPi LCD service..
Filesystem is locked - Read Only access
type ' rpi-rw ' to unlock
Tue 18 Apr 18:37:12 EDT 2017
...................
emonPi update done

All looks fine from the update log.

It looks like you may have some faulty hardware. We will send you a replacement emonPi. Please could you let us know if this fixes the issue and in due course send the faulty unit back to us for inspection and repair.

Very sorry for the hassle.