Hi,
I cannot get valid data from the Flukso device with curl.
The wan IP address is 192.168.1.2. I have set up an Ad-hoc wifi network with my laptop. Firewall rule is adapted, and I can see the homepage of the Flukso device via WAN from my laptop.
Json/REST API is enabled in the web configuration panel.
The first sensor is connected to the sensor1 slot with a clamp measuring a running 230v device. (one phase)
When I try to get data from Flukso device via curl from my laptop, I can see the following response :
Command :
- curl -v "http://192.168.1.2:8080/sensor/e2e0271b0836aa95ddf101887a9e81e4?version=1.0&interval=minute&unit=watt"
Result :
- * About to connect() to 192.168.1.2 port 8080 (#0)
- * Trying 192.168.1.2... connected
- > GET /sensor/e2e0271b0836aa95ddf101887a9e81e4?version=1.0&interval=minute&unit=watt HTTP/1.1
- > User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.0e zlib/1.2.5 c-ares/1.7.5 libidn/1.22 libssh2/1.2.9
- > Host: 192.168.1.2:8080
- > Accept: */*
- >
- < HTTP/1.1 200 OK
- < Content-Type: text/plain
- < Transfer-Encoding: chunked
- <
- * Leftovers after chunking: 5 bytesConnection #0 to host 192.168.1.2 left intact
- * Closing connection #0
I observed "* Leftovers after chunking: 5 bytes", but I don't have any idea to identify the root cause of the problem.
Can you help me ?
Does anyone observed this issue before ?
Thanks,
Michel
Can you see your data after you log into the Flukso site and look at your Dash?
Hello Bazzle,
Thank you for your message.
I finally figured it out with some troubleshooting tests... :)
My Flukso device will never be connected to the Internet, or a DNS or DHCP server. It will be used for local measurement only from a computer with the curl command (not via Dash).
I think that the Flukso device needs at least one time synchronization to work properly. Because it was never time synced, the date was 1901/01/01 ...
As soon as I synced the date with an local ntp server, the Flukso responded correctly with real data.
I don't know why the date is important because no ssl certificate or https is used.
Nevertheless, here is what I did in a nutshell (from memory):
1. Set up a permanent ntp server on the same LAN
2. Add the IP address of this server in /etc/config/timeserver
3. Execute "uci commit"
4. Reboot : Unplug the power cord from the Flukso device, then insert it back.
I hope it could help others.
Kr,
Michel
All readings inside the FLM are timestamped. There are some checks against timestamps from the '70s. These just get discarded since they would a.o. create a lot of confusion in the Flukso dash.