I was suspecting something like an autoupdate looking at the boot message . Personally iām not such a big fan (donāt fix it if it isnāt broken), so maybe you can make this feature user selectable (havenāt looked if itās not already)?
I was planning on making an adapted version on one of the other pcbās i got, but with spare parts (i have 5 more mcp3008 lying around, and another rtc), so iāll look into this autoupdate version.
I used the latest version from git for the ino files (i compiled it myself to change the voltage referenced). The changelog says 2.02.10.
I updated the files on the sd card as well, and it stays 0 for the outputs. (just for the record, iām not running a āserverā (Web Service Type is set to none"))
Copy-pasting the ārefvoltsā:1, strangely didnāt work, but manually typing it worked
Sorry to keep bothering you, just let me know to stop
I have my config.txt here: www.hetgrensland.be/iota/config.txt
a screenshot for the configure outputs: www.hetgrensland.be/iota/inputs.JPG
a screenshot for the configure outputs detail: www.hetgrensland.be/iota/inputs2.JPG
a screenshot for the status screen: www.hetgrensland.be/iota/status.JPG
I also tried to use emonCMS with my own server, but it seems to fail, maybe due to a IP? (server is running on a synology)
UPDATE: seems to be related to the HTTP/1.1 on line 311 in eMonService)
a screenshot for the server config: www.hetgrensland.be/iota/server.JPG (see also the config.txt)
and a screenshot of the serial console: www.hetgrensland.be/iota/serial.JPG
Pasting the url visible in the serial console, with the 10.0.2.115 in front does work (the feeds show up on the server) but with an error (SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data) and raw data (in firefox (ok) This server also receives input from my diy emonPi
Strange thing: sending it to the emonPi first gave error (invalid api key) but after a reset workedā¦
Another minor problem: the link in the serial console http://IotaWatt.local seems not to work on my system, maybe you could add the IP also?
To answer your other question: yes, i used the mcp3208 for this version, but since i have them lying around, and 30 circuits to measure, i was thinking of making a ālesserā version
Everything looks OK to me, so I have no idea what might be going on. Itās possible that some of the other include libraries that I have are modified or older versions and so we donāt have the same code. What I would recommend is that you leave the updater service startup in place, set the version of your code to 02.02.09, load it ans let it auto update to my 02.02.10. Then see if it works, making double sure you have the index.htm thatās on the Github site.
https doesnāt work. Use http for now. Itās about not having enough heap to support ClientSecure. We have a solution but itās not ready yet.
should work with the ip address. to use IotaWatt.local, your browser device must support mDNS (muticast DNS). The most common implementation is Appleās Bonjour, which you can download from them. There are others as well.
Iāve only coded and tested for emoncms.org. Glyn Hudson recently got his IotaWatt running with his eMonPi. Version 2.02.10 has the changes that enabled that. This is a whole area that will have to be tackled as time allows. The immediate intent is to support emoncms.org and the pi as configured by OEM. If you figure it out before I do, please share.
I found out that the problem with the ānormalā http send in eMonSend is that itās not accepted by the synology standard webserver. I think itās connected to the fact that itās HTTP/1.0 i changed the
"WifiClient.println(String("GET ā) + req);ā
Because of this i had to change the check of the reply (itās not just ok anymore but HTTP/1.1 200 OK and a lot more)
I changed it to: (i guess that the first check isnāt needed anymore.
if(reply.substring(0,2) != āokā && reply.substring(13,15) != āOKā ){
This works, for me. however, sometimes i get a timeout . Increasing the timeout from 200 to 1000 seems to solve this.
I tried this solution with my emonpi (the old way worked with this also) and with the emoncms running on my synology.
That whole area was coded a long time ago and tested to work with emonCMS.org. It will be changing soon to use http POST, with encrypted data. Post also seems to be returning the full http header info to client.read, so there needs to be code to parse that and get at the data that follows which will be a sha256 acknowledgement. Iām looking at using httpclient to do that, although Iām not really sure at this point.
The GitHub master version definitely isnāt the latest, but it should match the auto-update 2.02.10.
Yes, itās possible my libraries are different from yours, although I cant imagine why that would cause outputs not to work. Iāll make a note to refresh my libraries. I do have an old version of arduinoJson.
Could it be that webServer.ino file has been changed since the github version, more specific the if(server.hasArg(āoutputsā)) on line 281 and next?
Because if I uncomment your Serial.print lines in IotaOutputChannel.h (lines 146-150) I always get 0.00; 1, 0.00 on serial. (when calling /status?outputs=yes)
No matter how may operands the output has in it, i only shows up one time.
No, thatās not it. If that were evaluated false, there would be no attempt to send any output channels.
Thatās a good clue. Every script evaluation should begin with that line as those are the initial values when entering the function, but more lines should be generated as the tokens are evaluated. I would have expected a line when the input_3 line was evaluated. It looks as if the script was not properly encoded into runtime tokens.
On the surface it is indicative of a mismatch between my libraries and what you have, and it may be something that eventually comes to the surface, but I donāt want to spend the back-and-forth to try and determine if thatās really it and if we have different libraries.
Unfortunately, I have little motivation to work on the problem as is because I have another branch containing a complete rework of the scripting feature that is just waiting to go. I havenāt rolled it out because I need to more thoroughly test the code that converts old scripts to new, and because the configuration app also has a complete rework of the logic under the ācalculatorā interface. This is one of the few remaining major changes on my short list to an actual release.
I believe you should be able to see that branch called convert-to-new-output-script. That branch is compatible with the current master branch, so if you want to head farther out on the bleading edge, compile that and try it, otherwise, Iāll be merging it into master in the next week or two. Make sure to grab the index.htm file in that branch as it wont work without it.
A little ahead of schedule. Updated master branch to 2.02.11 to convert to the new scripting format. If you still have auto update on, it should load within an hour. This version will still accept the old scripts, converting them to the new format for internal use but leaving the old format in the config.txt file.
After the update, installing the latest index.htm from the SD directory on Github will convert the old scripts the next time it stores an updated config file (after any edit).
If you like, you could try just compiling the new source to see if outputs work with your libraries. Iād be interested in the result.
Nice work!
I recompiled it (with the changes for my emoncms server), and changed the index.htm through the website
The result is a partial succes.
The output does work now (on the input channels status page) , but there seems to be a problem with the webpage for the configure outputs : the first tim (with the old rules in the txt file) it works normal. But after changing them it does not anymore: i attached a screenshot with the errors from firefox console. It seems that there is a TypeError. I havenāt looked into it yet but wanted to share it.
screenshot: www.hetgrensland.be/iota/configout.JPG
UPDATE: i think i found the problem: itās in the function checkConfig()
there it checks config.format == 1, this is always true it seems, disabeling
config.outputs[i].script = old2newScript(config.outputs[i].script);
makes it to work.
I think maybe you forgot to set and read the format type in config.txt?
I found it. I will post the corrected index.htm today, but the damage is done for you. Please edit your config.txt file to change the format to 2.
āFormatā: 2,
There was one last bug ( if you believe that) that didnāt make it to the Git. Line 1247 in index.htm should read config.format = 2;
(Instead of config.format == 2;)
Frankly I,m amazed that you were able to build one and get it working first try with only the schematic to go on. Also, that the software is working as well as it is fresh to the outside world. These problems were all minor and easily solved - no hardware issues to speak of.
Iāve got a few IotaWatt running in various sites in the US, but they are really just people who agreed to let me run them in their homes. They contribute nothing to the testing and development.
Iām looking forward to you getting the three phase going because I donāt have any three phase test sites. Iāve programmed for it, but I feel like the guy in Flight of the Phoenix who built āmodelā planes. Weāll see how it flies.
If youāre up for it, there are some experiments that I would like to run to determine the accuracy of measuring three phase with only only one VT. The approach is the same as the Emon āthree phase sketchā, but can be done through the config utility and should be more accurate because the sample rate is ten times that of the TX.
Iāll probably start a new thread āIotaWatt three phaseā when the time is right. There will probably be some configuration options to turn on three phase specific configuration options so as not to burden the 99% with that complexity. Same goes for the forum thread.
Thanks, iāve been looking at the project for some time and i have build my own frankenstein emon (first 3 ct but adapted to 7) with a custom 3-phase script i adapted from the forum. So i wasnāt completely a noob .
However, looking at your project and code iām still amazed how good it is put together and how good it has been engineered. (i still canāt grasp everything from your code, so iāll have some more digging to do
Sure iām willing to help you out with a 3 phase test, just let me know. (currently i have 5 extra ct and 2 extra vt next to the running old setup)
The 3 phase setup (emon) i have running now is doing relatively ok, but i can see that the measurements of a minor consumer (eg 5 to 10 watts) is sometimes influenced by a big one. Since i was at the limit of the arduino nano running it (without using extenders etc) i was happy that your project came along!