-
-
-
-
-
If you get a prompt, you can send a reset and then save.
The strings at the beginning are at the wrong baud rate.
The rtc mem data means it can read the last time from flash, but it sounds like there are other issues.
Best bet is to use the flash tool, with the erase option. This will blank out everything, then reflash and it should be fine.
-
I'm looking through your updates, and trying to follow:
old line 128:
if (opcode == 0xA) return this.emit('pong');
new:
if (opcode == 0xA) { this.emit('pong'); return }
Aren't these equivalent?
and also here line 182sh:
this.socket.write(socketHeader.join("\r\n"));
and new:
for (var index = 0; index < socketHeader.length; index++) { this.socket.write(socketHeader[index] + "\r\n"); }
-
-
@allObjects - that's a great idea - I had actually opened the cvs in excel and plotted there... Much easier to do within the web ide in realtime!
-
Great to see you testing the code.
You really should not be setting internal parts of the library -
ctr.out=0.0;
At this point - you could call
ctr.compute();
if you have set a value for input. There is actr.setOutput(x)
- however this is intended to be used if the controller in manual mode.Same goes for getting the output
ctr.getOutput()
. If the internal implementation of the library was changed and internal vars renamed (i.e. perhaps shorted to save space), your code could break... -
@tve recommends these pins for the esp8266
https://gitter.im/espruino/Espruino?at=572c3c4612cceadb7b1b25db
Just realised you are part of this thread....
Have you any other i2c device you can try other than the wii controller....
-
Are the 4,5 above the same - does it refer to gpio # or PIN number, or board label?
Perhaps try
NodeMCU:D4
andNodeMCU:D5
as these map the board labeling to pin numbering... http://www.espruino.com/Reference#l_NodeMCU_D0 -
The attachment here has been updated to the human readable form:
#4 http://forum.espruino.com/comments/12972573/
The module is a port of the reference that @tve mentioned above. This an adaption of the node version here: https://github.com/wilberforce/pid-controller made suitable for the Espurino.
-
Here is the reference to the auto tune library:
http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/
And the code:
-
-
-
-
The arduino pid library has a self learning module. I've not implemented that yet.depending on what you are heating, it can take some time to raise the temp by a degree. And then if it overshoots it takes quite a bit of time for that degree to drop back to the first level.... In my case I'm heating 18L of water, and with a 3w element it can crank out about 1 deg/min. I think the current P value I have 14.
-
-
Please find a attached a port of the Arduino pid library to the Espruino. Function names have been shortened, to make it more suitable for this environment. If there is interest, I'll comment the code and submit it as a module.
In the short term, this can be saved as a local module for testing.
var PID = require('pid-controller'); var model = {}; model.temp = [0, 0]; model.setpoint = 66; model.duty = 0; var config = { mash : { "Kc" : 10, "Ti" : 2, "Td" : 2, "setPoint" : model.setpoint, cycleTime : 2000 } }; var ctr = new PID(model.temp[0], config.mash.setPoint, config.mash.Kc, config.mash.Ti, config.mash.Td, PID.fwd); ctr.mode(PID.auto); ctr.setLimits(0, 100); setInterval(function () { ctr.compute(); model.duty = ctr.getOutput(); }, 200);
-
Some random thoughts:
There is a page size difference with arm/esp8266 - 256/4096 .
Can a closure compiler or similar be used to work out what is "constant" so that goes directly to flash?
You seem to be describing a write through cache. For rapidly changing vars, loops interators etc, these don't need to go flash at all.
-
Perhaps the most straightforward would be to use an esp8266-01 module for each pico, although if all were in station mode, you would need a central router to talk to. If there were in ap mode, you would have to connect to each one in turn to send updates.
You possible could have one in ap mode, and have the other unit and your phone connect to that ap, so that everything is on the same network.
-
If you connect to the serial debug pin with another ftdi , you can see the output there and see more of what is going on.
Can't remember the pin off hand, I think it's labelled D4 on the nodeMcu board