Forum Replies Created
-
AuthorPosts
-
Csaba TothParticipantHi Ray and Samer,
Thanks for the answer, I am working on the changes with colleagues, just the learning curve could have been saved, if…
The Hw, Firmware adjustment to sensors handling is in good shape, the cloud server connection is under test, the Ui questions are on debate.Some tech questions:
According to my observation the UI calls increasing the epoch time field by 1 at each calls (what takes place in every 5 seconds).At starting the UI, there are 3 ssh calls established:
api.github.com:443
api.wunderground.com:443
ui.opensprinkler.com:443
All looks ssh calls, but only opensprinkler and wunderground have data transfer in my monitor.
Can you tell some words about the content?At start /jp, /jn, /jo, /js, /jc queries are requested separately, then /ja is requested in every 5 secs.
Does it have some practical sense?Security is becoming more and more important. From this point the plain http data transfer is not safe.
Although the password MD5 hashed, but this is paperweight security.The AVR8 structure does not gives a wide encoding selection, but have you got any idea to increase the data security in the transfer?
Thanks.
Csaba TothParticipantI haven’t seen you post when I was edited my previous post. I don’t have any clue about Ajax at the moment.
The epoch time in the GET command could be used for time synchronization if it would be precise, for example.
In this form it is only increasing the the load of the communication line.Best regards.
Csaba TothParticipantHi Samer,
It looks to increase the epoch timer value by 1 msec at every 5 seconds.
So it is something different.Anyway our small team is on the way to add sensors to the OS system. The present config will upgrade from one sensor input to 4 inputs.
Rainsensor, Flowsensor, 2 soil sensors (one for sunny one for shaded areas).
Plus current sensor of the valve load.Based on sensor measurement we are adding diagnostic & alarming features too.
I have made the hw design, tests, and the firmware is under coding.
It can be added to any existing OS systems (not OSPi at the moment) using the PT2 connector.
I will post it for the community after the appropriate test cycle to recive the more extensive field test of the contributors.This will need to change the UI.
I will make a very straightforward description about the changes we need for above features.
At the moment our team is lack of javascript developers.
Can you make the coding of the required changes in the UI?Thanks, Csaba
Csaba TothParticipantThanks Samer!
The attachment at the end of GET request is something different.
Look took the sequence of calls on the picture.Csaba
Attachments:
Csaba TothParticipantRay and Shawn
Thank you for the answers.
I have realized in meantime the options are calculated automatically if I rewrite the MAX_PROGRAMDATA parameter. Thanks for the clarification of the 2 starting bytes.
The eeprom MAC address is quite new for me. I think there should be a “default MAC” in the firmware, because it works without this eeprom populated, but I only tried with one instance.
May be you have analysed using flash memory instead of SD, because SD is not a long term memory solution in my mind.WE have started a cloud based experiment to eliminate the dynamic IP, and port forwarding features.
My idea is to set up a data puffer between the UI requests and the firmware responses.
The firmware regularly polls the cloud server sending the answer to “Get All = /ja?..” content to the server. The server stores the results.
Each day logs also stored on the server.
If there is a request from the UI what can’t be handled based on the “polled data” the server would sending to the firmware as an UI request.
The firmware will make the answer and changes what is requested, like present style.
The server have to keep the UI in controlled waiting position till the time while the firmware will poll next time the server and can serve the request.
The server will know when the next poll is expected, so the UI can be informed the user how long have to wait for the action.At the moment we have the server side what communicate through the API commands to the firmware and stores the answers.
Next we should make the polling function in the firmware.
Some new API function will be applied to handle the sensor’s data and the cloud operation.
Also the appropriate UI changes should be done, what still the weakest point.I would like to see your opinion about the idea.
Csaba TothParticipantThanks Ray,
My prompt answer has been lost somewhere.
I had have a period of other projects duty. But now I am back to finish the coding of the sensor handling.
In ver.217 the 17 program space is 2433 bytes what shows one program needs 143 bytes. Is there a program structure layout?
To handle the flow and current alerts we need minimum of 112 bytes plus some OPTION bytes as I see now.
The only option is to decrease the number of programs by one or two to make the space.There is a 24aa.. I2C eeprom in the OS design. I haven’t found any code what using this memory.
What is the original purpose?From ver.216 minor4(?) SD is a must. As I see this is needed for additional storage space. Do you have some plan for increase the internal memory space?
Csaba
Csaba TothParticipant
Csaba TothParticipantI have found the solution.
The op_json_names list have to be synchronized with the option list.Now I have flow, current logs on the SD card, the code part:
ultoa(curr_time, tmp_buffer+strlen(tmp_buffer), 10);
if((os.options[OPTION_SENSOR_TYPE]==SENSOR_TYPE_FLOW) && (type==LOGDATA_STATION)) {
// RAH implementation of flow sensor at the end of all progammed station cycle
strcat_P(tmp_buffer, PSTR(“,”));
#if defined(ARDUINO)
dtostrf(flow_last_gpm,5,2,tmp_buffer+strlen(tmp_buffer)); //the flow log
strcat_P(tmp_buffer, PSTR(“,”));
ultoa(os.read_current(), tmp_buffer+strlen(tmp_buffer), 10); //the current log
#else
sprintf(tmp_buffer+strlen(tmp_buffer), “%5.2f”, flow_last_gpm);
#endif
}
strcat_P(tmp_buffer, PSTR(“]\r\n”));The log record looks like this:
[254,0,60,1485681437,121.70,296]
Program once, station1, 60 seconds, unix time, liter per minute, current milliamper.
Csaba TothParticipantFinally and happily I was able to launch my JTAG ICE debugger on OpenSprinkler:
– use the I2C LCD, it works automatic flawless, thanks Ray,
– a bit of reorganization of pin functions to release PC2 – PC5,
– Setup Atmel Studio 7 + Visual Micro + Atmel ICE.
Now Hw breakpoint feature is in operation and I see, I should change topics because the firmware works well.The UI is start over continously calling the html header.
Probably there has been changed some data what makes an infinite loop in the UI.
I haven’t changed a lot in the existing code, but there are 3 sensors paralel what used to be on one input before.I haven’t explored the UI, how can I get the UI back to normal operation?
Csaba TothParticipantI have found the code meantime.
But As I see nothing happens with the current in this version, no display no log, no alarm.
Or I just couldn’t find it.I am planning an alarm condition handling for flow and current faults.
Also I have separated the sensor functions to 3 inputs.
Rain / Program Switch
Flow Sensor
Soil Moisture SensorThe system specification and hardware is close to finish. I have some experience in coding, but this job beyond my present knowledge.
The coding should fit into the present logic of the firmware what again is not my level of understanding.
If there is somebody with skills required and interested in this project to complete, I would be happy to work together.I have studied the ACS712 to use for this purpose. The smallest range is +-5A (10A swing). One valve is around 0,25A, what makes 46 mV change on the output. Because the output is quite noisy I think this would not work well for this job. Moreover there is a half-supply output bias so the amplification would make some pain.
After several circuits tested I have made the 2 OpAmp choice what I have shown in my previous post.
Tested under real environment using max. 4 valves it has been proved to be fine for the project.And also your solution is fine for fault detection. Solenoids used to break and wires are cut or short. Never seen shorted solenoid. Valves draw 200 – 275mA So the 16mA resolution should be enough.Some autozero routine would make the current measurement more precise avoiding the OpAmp offset errors.
November 21, 2016 at 10:13 am in reply to: Cloud Sync avoiding Port Forwarding and ddns pains #44705
Csaba TothParticipantWhat is your guess when the cloud sync implementation will be done? If I am right the UI can work with the older version through port forwarding and with the new cloud server version paralel. The UI can read the version and handle the differences.
Csaba TothParticipantWhen you use one OpAmp for current sensing there is no amplification. Assuming 3 valves the output voltage range is around 0,75A * 0,2ohm = 150mV. Depending on the offset it could be worse. The LSB of ADC is 3,2mV using the 3.3V supply as reference. Full scale swing is 50 LSB for 3 valves, 16 LSB for one valve. This still could be enough for current fault detection, but the resolution is quite low.
In my solution there is an amplification, to make sure the wider swing, the resolution for one valve is 137 LSB what definitely enough for valve diagnostics.
As most OpAmps are dual version, the 2 OpAmp solution has no cost increase, and LM358 vs MCP602 doesn’t make a serious difference.
This circuit was not working well using LM358 due to the limited output swing.
For protection I like the 5V TVSS solution vs. the the BAV199 diodes.Attachments:
Csaba TothParticipantRay, replying to the current sensor topic. Since my post I have brushed a bit the circuit. Pobably the LM358 one opamp version can be used well for current trouble sensing. Does the firmware handling the current sensor in the new version 2.1.7? As I seen the user manual, the UI not yet prepared to process the current deviations.
Csaba TothParticipantThe sensors schematics.
Attachments:
Csaba TothParticipantHi Ray,
Where I can find the solution for current-sensing? I have surfed the github hw content there is no change.
I have just designed and tested a current sensor, what can be used for OsPi and Os as well.
I make a drawing soon and attach it.I also separated the sensor inputs: rain switch, flow-sensor, and soil moisture sensor either switch or analogue version.
I also attach the hw solution.I have seen in a different post, where you inform about the new firmware version is on the way.
Do you think the current sensor and the separate sensor inputs can be fitted in that version?Thanks, Csaba
Csaba TothParticipantI think I found the answer of the RTC question:
http://rayshobby.net/mediawiki/index.php/Real_Time_Clock_(RTC)_Set_upDoes it works well with the current version?
Csaba TothParticipantI have downloaded the image, but I can’t setup the wifi.
If I setup the Pi-Zero from Noobs, and install the firmware and setup the wifi according to this link, it works: http://www.instructables.com/id/How-to-give-an-internet-access-to-Raspberry-Pi-Zer/step4/Solution-4.
It is absolutely needed for the wifi to work.The downloaded SDimage can’t be upgraded and updated according to the link.
Thanks.
Csaba TothParticipant@Ray
1. RTC and real time:
If I connected by Eth cable the real time is real.
If I connected by wifi the link is not settled by the time the NTP is taken during boot and it starts from the last shutdown time.
How can I setup the automatic NTP update in Rpi?
I have inserted in /etc/rc.local: rdate -ns hu.pool.ntp.org, but it works only by Ethernet connection.
Using wifi it works in command line after booting, and that corrects the real time in the firmware.To use the RTC:
a. we should have a manual “Time setup menu”: sync to NTP or ENTER the value. This writes the RTC registers to the real value.
Or automatic update of the RTC from NTP some times, when the connection is fine.
b. Then the firmware always should read the RTC for the real time operations.I would appreciate to read practical solution to have stable real time in the firmware.
2. Where that given name should appear on the screen?
Csaba TothParticipant@sakos
Szép Napot!
I see you are quite advanced in the Ospi install and use.
I am struggling for 2 weeks it is working, but I stuck at more and more traps.
I am just downloading and imaging your OSPI_216 version, I am quite interested.If you don’t mind I would contact you in PM -in Hungarian- if possible. Pls. send your email to <my_forum_name>@freemail.hu
Thanks, Csaba
Csaba TothParticipantDear Erik: thanks, this helped a lot.
netstat shows what is in the background (pic).Now it is working. Probably it has worked all time.
The mistake was, that I was regularly checking only the Ip address, looking for the welcome page, as it was the case on my existing and working Pi2 installation.
But Pi2 was installed by the downloaded image file and that is different as I see.
The Ip:Port address immediately linked to the page.About disabling the GUI:
I don’t think that disabling the GUI is needed.
As I experienced, the web server is launced before the GUI is started. The boot time of the server is about 30sec, what is acceptable.
About the same boot time is measured on Pi2 installation what has no GUI.Thanks for the help.
The next questions what I am facing:
1.
How to setup the time from the webpage?
How the RTC is loaded by the right date/time?
As I remember I haven’t done anything at the Pi2 install, and the time is correct. (see pics)
In the Pi3 install it is wrong. Both set to the same timezone and location.I can set the time in command line, but I think this should work from the page.
Is there a manual what to do?2.
Is it possible to assign a name to the controller?
Like House A, Cottage B….3.
In the Edit Options/ Advanced menu there is a device ID.
What is this for?Thanks for the help.
Attachments:
Csaba TothParticipantExcuse me Ray, I am not very familiar with the expressions. I am learning hard.
I have a working Pi2 based Ospi, what was installed by the image dowloaded to an SD card.
But I can’t do the same with a Pi3. I did according to Samer suggested.
Still not succeded.I try to make it clear:
I have installed the Pi3 Linux, then the Firmware as it was written above.
The http server started once, not any more, since then I can’t access on the appropriate Ip address.I have a working Pi2 based ospi, what I can access in the same network, when I type the Pi2-ip address of the Pi2-OSPI, a version install description page comes up.
If I try the Pi3-ip address: access denied.
If I run in command line the build.sh script, nothing changed.I think the http server is not running at all.
How can I check, the http server is running? I cant find it in the Task Manager.I don’t know what files should be in where to launch the server at boot?
How can I cleanup the whole OpenSprinkler and start over again the installation?
OpenSprinker.launch is a file in the Firmware folder, where the auto boot commands are written.
I did according to this, no change.I know the GUI is not needed. This is why I asked how can I prevent from booting the GUI (after the http server works correctly).
Thanks!
Csaba TothParticipantI have deep gaps in using the OpSystem….
Now (I think) I can update, build, remove the Firmware.
But I can’t start the application.
Even when it appears in the Task Manager, not responding on the Ip address link.I would appreciate if I would get answers:
How can I start the Application from the terminal?
How can I make it autostart at boot? I tried the OpenSprinkler.launch description, but I have failed.
How can I prevent the GUI to start at boot, to make it faster?Thanks in advance!
Csaba TothParticipantRay, at my suppliers the Pi2 is more expensive than Pi3, and right now only Pi3 available.
Pi3: 35,3 USD, while Pi2 38,6 USD plus the wifi dongle! Older models are discontinued.When Pi-zero will be available, that can be the good option.
Csaba TothParticipantThanks Samer!
I was able to set up.
It has booted once, I have changed the port. Then after reboot I couldn’t connect.It is not booting anymore, the task manager doesn’t show the OpenSprinkler task by itself.
I have to start by hand to show in the tasks list.But even with manual starting there is a mistake I can’t reach the web server using the device IP.
-
AuthorPosts