Iotawatt Fails to post to EmonCMS

So around noon today IotaWatt and EmonCMS started to not play nice. Looking at the logs in IotaWatt I see the following.

SD initialized.
10/28/19 23:24:58z Real Time Clock is running. Unix time 1572305098
10/28/19 23:24:58z Reset reason: Software/System restart
10/28/19 23:24:58z Trace: 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:1[8], 1:2[10], 9:0[10], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 10:2, 10:3
10/28/19 23:24:58z ESP8266 ChipID: 6348181
10/28/19 23:24:58z IoTaWatt 5.0, Firmware version 02_04_02
10/28/19 23:24:58z SPIFFS mounted.
10/29/19 04:24:59 Local time zone: +5:00
10/29/19 04:24:59 device name: IotaWatt
10/29/19 04:24:59 MDNS responder started for hostname IotaWatt
10/29/19 04:24:59 LLMNR responder started for hostname IotaWatt
10/29/19 04:24:59 HTTP server started
10/29/19 04:24:59 timeSync: service started.
10/29/19 04:24:59 statService: started.
10/29/19 04:24:59 Updater: service started. Auto-update class is MINOR
10/29/19 04:24:59 dataLog: service started.
10/29/19 04:25:00 dataLog: Last log entry 10/29/19 04:24:55
10/29/19 04:25:00 WiFi connected. SSID=FBI Surveillance Van Cat1, IP=192.168.1.13, channel=11, RSSI -62db
10/29/19 04:25:00 Updater: Auto-update is current for class MINOR.
10/29/19 04:25:04 EmonService: started. url=192.168.1.21:80/emoncms, node=IotaWatt, interval=5
10/29/19 04:25:05 EmonService: Start posting at 10/28/19 21:53:25
10/29/19 04:25:59 historyLog: service started.
10/29/19 04:25:59 historyLog: Last log entry 10/29/19 04:24:00
10/29/19 04:27:08 EmonService: HTTP response -11, retrying.

The HTTP response is something I’m not familiar with. Not sure how to proceed.

Welcome, Ryan, to the OEM forum.

Standard HTTP responses start at 100, so “11” must be special to Iotawatt.

I suggest The IoTaWatt forum is a better place to ask your question, as it seems that it is specifically about the operation and use of IoTaWatt. That is managed by Bob Lemaire, its creator, and he and the other users there are more likely to have the specific knowledge to help you.

The IoTaWatt forum uses the same software as this forum, but you must register a new account there. If the user name you have here is not taken, it might be helpful to have the same user name in both places.

If you post your question there, I’m sure he or somebody will get back to you quickly.

Have you done an update? What Emoncms version are you on?

There is something about using a URL of just the IP without the emoncms part of the URL. I think @TrystanLea fixed it in a later release.

I ran an update on EmonCMS yesterday but it reported no update but then I did see a post recently about there being some sort of update within the last few days so maybe there was one and it grabbed it. was there a recent update that had a change to the address Iotawatt should be reporting to now?

I checked my tablet that has the app display and it had an error on it that I took a picture of that might give us something more to look at.

I should add that I have to OpenEVSE chargers that are also tied into EmonCMS that are still updating and reporting without a problem.

@Ryan_S, can you click on ‘copy as markdown’ button in admin next to server information and post it please (no further formatting required).

Once I get home this afternoon I can do that. If you could answer is the copy has mark down the log for EmonCMS? I ask this just so I know in the future where I can get the log for any errors that might occur so I might be able to fix them myself.

No it just captures the system configuration.

Logs should be in /var/log/emoncms for all the bits now but that does depend on your install.

Sorry for the delay. Here is the server information as requested.

Server Information

Server Information

Services

  • emonhub :- Active Running
  • emoncms_mqtt :- Active Running
  • feedwriter :- Active Running - sleep 60s 448 feed points pending write
  • service-runner :- Active Running
  • emonPiLCD :- Active Exited
  • redis-server :- Active Running
  • mosquitto :- Active Running

Emoncms

Server

  • OS :- Linux 4.14.71+
  • Host :- emonpi | emonpi | (192.168.1.21)
  • Date :- 2019-10-28 23:43:06 UTC
  • Uptime :- 23:43:06 up 51 min, 0 users, load average: 1.82, 1.82, 1.62

Memory

  • RAM :- Used: 31.59%
    • Total :- 481.05 MB
    • Used :- 151.96 MB
    • Free :- 329.09 MB
  • Swap :- Used: 0.00%
    • Total :- 100 MB
    • Used :- 0 B
    • Free :- 100 MB
      Write Load Period

Disk

  • / :- Used: 40.28%
    • Total :- 3.81 GB
    • Used :- 1.54 GB
    • Free :- 2.1 GB
    • Write Load :- 41.58 B/s (6 mins)
  • /boot :- Used: 51.69%
    • Total :- 42.52 MB
    • Used :- 21.98 MB
    • Free :- 20.54 MB
    • Write Load :- 0 B/s (6 mins)
  • /home/pi/data :- Used: 5.46%
    • Total :- 3.21 GB
    • Used :- 179.16 MB
    • Free :- 2.87 GB
    • Write Load :- 678.34 B/s (6 mins)

HTTP

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

MySQL

  • Version :- 5.5.5-10.1.23-MariaDB-9+deb9u1
  • Host :- localhost:6379 (127.0.0.1)
  • Date :- 2019-10-28 23:43:05 (UTC 00:00‌​)
  • Stats :- Uptime: 3037 Threads: 5 Questions: 9751 Slow queries: 0 Opens: 30 Flush tables: 1 Open tables: 24 Queries per second avg: 3.210

Redis

  • Version :-
    • Redis Server :- 3.2.6
    • PHP Redis :- 4.1.1
  • Host :- localhost:6379
  • Size :- 0 keys (728.66K)
  • Uptime :- 0 days

MQTT Server

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

PHP

  • Version :- 7.0.30-0+deb9u1 (Zend Version 3.0.0)
  • Modules :- apache2handler | calendar v7.0.30-0+deb9u1 | Core v7.0.30-0+deb9u1 | ctype v7.0.30-0+deb9u1 | curl v7.0.30-0+deb9u1 | date v7.0.30-0+deb9u1 | dom v20031129 | exif v7.0.30-0+deb9u1 | fileinfo v1.0.5 | filter v7.0.30-0+deb9u1 | ftp v7.0.30-0+deb9u1 | gd v7.0.30-0+deb9u1 | gettext v7.0.30-0+deb9u1 | hash v1.0 | iconv v7.0.30-0+deb9u1 | igbinary v2.0.1 | json v1.4.0 | libxml v7.0.30-0+deb9u1 | mbstring v7.0.30-0+deb9u1 | mcrypt v7.0.30-0+deb9u1 | mosquitto v0.4.0 | mysqli v7.0.30-0+deb9u1 | mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ | openssl v7.0.30-0+deb9u1 | pcre v7.0.30-0+deb9u1 | PDO v7.0.30-0+deb9u1 | pdo_mysql v7.0.30-0+deb9u1 | Phar v2.0.2 | posix v7.0.30-0+deb9u1 | readline v7.0.30-0+deb9u1 | redis v4.1.1 | Reflection v7.0.30-0+deb9u1 | session v7.0.30-0+deb9u1 | shmop v7.0.30-0+deb9u1 | SimpleXML v7.0.30-0+deb9u1 | sockets v7.0.30-0+deb9u1 | SPL v7.0.30-0+deb9u1 | standard v7.0.30-0+deb9u1 | sysvmsg v7.0.30-0+deb9u1 | sysvsem v7.0.30-0+deb9u1 | sysvshm v7.0.30-0+deb9u1 | tokenizer v7.0.30-0+deb9u1 | wddx v7.0.30-0+deb9u1 | xml v7.0.30-0+deb9u1 | xmlreader v7.0.30-0+deb9u1 | xmlwriter v7.0.30-0+deb9u1 | xsl v7.0.30-0+deb9u1 | Zend OPcache v7.0.30-0+deb9u1 | zlib v7.0.30-0+deb9u1

Pi

  • Model :- Raspberry Pi Model B Rev 2.0 - 512MB (Sony UK)

  • Serial num. :- 7CB2DEB8

  • Temperature :- 43.31°C - 43.3°C

  • emonpiRelease :- emonSD-30Oct18

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36
  • Language :- en-US,en;q=0.9

Window

  • Size :- 1351 x 669

Screen

  • Resolution :- 1366 x 768

I’ve also taken a look at the logs though ssh in the /var/log/emoncms folder. Wish I could say that they gave me something to chew on.

LAST ENTRIES ON THE LOG FILE
2019-10-28 22:53:33.745|ERROR|index.php|Not Admin|admin/view
2019-10-28 22:53:53.451|WARN|emoncms_mqtt.php|Not connected, retrying connection
2019-10-28 22:53:53.506|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0

I have just tested the issue I mentioned above and confirmed that an input API call to both <IP> & <IP>/emoncms work, so that cannot be the issue.

Have you rebooted both devices?

Other than that, check the emoncms logs as well and see if there is anything there.

Only other thing to do is install tshark on the emoncms device and monitor the HTTP traffic (search here for tshark for some examples).

You always get a couple of those. Change the LogLevel to 1 (in settings.ini or settings.php) and see if that gives more info.

Both devices have been rebooted. I will reboot emonCMS again, just in case. I did post the log, are there any others that might help?

Yes saw that and commented. Your best bet is probably to use tshark or ask on the IotaWatt forum.

Looking into how to install tshark and configure it to start monitoring.

sudo apt install tshark
sudo tshark -Y http.request -T fields -e http.request.full_uri

or

sudo tshark tcp port 80

I kind of wondered if it was that. (Use Linux Mint myself). Got it installing right now.

Ok, got a capture. I can see both OpenEVSE responses and one with an api key.

http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/input/post.json?node=openevse1&json={“amp”:0,“wh”:1573990,“temp1”:220,“temp2”:-2560,“temp3”:-2560,“pilot”:40,“state”:254,“freeram”:27944,“divertmode”:1}&apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
HTTP://192.168.1.21/emoncms/input/bulk
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/input/post.json?node=openevse2&json={“amp”:0,“wh”:3751096,“temp1”:212,“temp2”:-2560,“temp3”:-2560,“pilot”:40,“state”:254,“freeram”:27952,“divertmode”:1}&apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/input/post.json?node=openevse1&json={“amp”:0,“wh”:1573990,“temp1”:220,“temp2”:-2560,“temp3”:-2560,“pilot”:40,“state”:254,“freeram”:27792,“divertmode”:1}&apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/data.json?apikey=###############################&id=59&start=1570739735000&end=1572381335000&mode=daily
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/feed/list.json?apikey=###############################
http://192.168.1.21/emoncms/config/getemonhublog
http://192.168.1.21/emoncms/config/getemonhublog

You really want to munge the API keys

This looks about right. Try the URL from a browser window.

[edit] - that URL worked for me (IP changed).

It reports with “ok”

Not worried about api since the EmonCMS server is internal to my network and not allowed external per the firewall.