Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 756
» Latest member: mjani
» Forum threads: 290
» Forum posts: 1,628

Full Statistics

Online Users
There are currently 5 online users.
» 0 Member(s) | 4 Guest(s)
Bing

Latest Threads
Monthly Adjust per Statio...
Forum: Writing plugins
Last Post: cdesouza
2024 Apr 18, 06:33 AM
» Replies: 17
» Views: 232
MQTT Plugin initialised b...
Forum: Report a problem
Last Post: cdesouza
2024 Mar 25, 03:56 PM
» Replies: 2
» Views: 44
Update to a new plugin ve...
Forum: Installation and set up questions
Last Post: cdesouza
2024 Mar 20, 09:12 PM
» Replies: 2
» Views: 57
Using moisture sensors to...
Forum: Writing plugins
Last Post: dan
2024 Mar 15, 02:55 PM
» Replies: 29
» Views: 479
OpenVPN / PiVPN setup ins...
Forum: Installation and set up questions
Last Post: Pieterke58
2024 Mar 12, 06:56 AM
» Replies: 3
» Views: 49
Moisture Sensor Chart
Forum: Writing plugins
Last Post: cdesouza
2024 Mar 08, 01:49 PM
» Replies: 4
» Views: 77
Problem whit Paho mqtt
Forum: Installation and set up questions
Last Post: DrLabel
2024 Feb 26, 07:12 PM
» Replies: 3
» Views: 86
Problem with Run Once and...
Forum: Report a problem
Last Post: cdesouza
2024 Jan 21, 07:07 PM
» Replies: 0
» Views: 40
Problem with concurrent m...
Forum: Report a problem
Last Post: dan
2024 Jan 21, 04:25 PM
» Replies: 1
» Views: 56
Plugin that adds water ta...
Forum: Writing plugins
Last Post: ahat
2024 Jan 07, 10:10 PM
» Replies: 11
» Views: 442

 
  MQTT Plugin initialised before network
Posted by: cdesouza - 2024 Mar 20, 09:20 PM - Forum: Report a problem - Replies (2)

After a reboot the MQTT plugin is intialised before the network is up, more specifically before dhcp has assigned an address


Code:
Mar 20 22:09:04 sip dhcpcd[364]: wlan0: rebinding lease of xxx.xxx.xxx.xxx
Mar 20 22:09:04 sip dhcpcd[364]: wlan0: probing address xxx.xxx.xxx.xxx/24
Mar 20 22:09:04 sip sip[456]: MQTT plugin couldn't initalize client: [Errno 101] Network is unreachable
Mar 20 22:09:04 sip sip[456]: Ignoring exception while loading the telegramBot plug-in.
Mar 20 22:09:04 sip sip[456]: No module named 'telegram'
Mar 20 22:09:05 sip sip[456]: plugins loaded:
Mar 20 22:09:05 sip sip[456]:  advance_control
Mar 20 22:09:05 sip sip[456]:  backup_settings
Mar 20 22:09:05 sip sip[456]:  mobile_app
Mar 20 22:09:05 sip sip[456]:  moisture_sensor_control
Mar 20 22:09:05 sip sip[456]:  moisture_sensor_data_mqtt
Mar 20 22:09:05 sip sip[456]:  mqtt
Mar 20 22:09:05 sip sip[456]:  plugin_manager
Mar 20 22:09:05 sip sip[456]:  relay_board
Mar 20 22:09:05 sip sip[456]:  schedule_data_collector
Mar 20 22:09:05 sip sip[456]:  shutdown_button
Mar 20 22:09:05 sip sip[456]:  simple_chart
Mar 20 22:09:05 sip sip[456]:  system_update
Mar 20 22:09:05 sip sip[456]: Starting timing loop
Mar 20 22:09:05 sip dhcpcd[364]: wlan0: Router Advertisement from xxxx::xxxx:xxxx:xxxx:xxxx
Mar 20 22:09:05 sip dhcpcd[364]: wlan0: adding address xxxx::xxxx:xxxx:xxxx:xxxx /64
Mar 20 22:09:05 sip kernel: ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms inste>
Mar 20 22:09:05 sip dhcpcd[364]: wlan0: adding route to xxxx::xxxx:xxxx:xxxx:xxxx ::/64
Mar 20 22:09:05 sip dhcpcd[364]: wlan0: requesting DHCPv6 information

Print this item

  Update to a new plugin version
Posted by: cdesouza - 2024 Mar 15, 01:40 PM - Forum: Installation and set up questions - Replies (2)

If there is a newer version of a plugin available how do I install it?

As far as I can see UPDATE ENABLED only enables/disables plugins by changing the .py file permissions. So the only way is to uninstall the plugin and reinstall it, losing the setting in the process.

In plugin_manager.py should update_plugins() not call install_plugins() one way or another?

Another option might be to have three separate functions Enable/Disable, Update and Uninstall

Print this item

  OpenVPN / PiVPN setup instruction
Posted by: Pieterke58 - 2024 Mar 10, 09:42 PM - Forum: Installation and set up questions - Replies (3)

Hi Dan, herewith a very newbie question from the Netherlands. I like to start with conveying my compliments for the SIP program and the work that you're are doing.

As mentioned I'm a newbie and glad that I have SIP now running on a Raspberry Pi 3. I'm able to control it in mine network with iPad and iMac, so far so good. Also ssh connecting to the Pi is working and so I have the ability to make changes etc.

I like to control it later on from outside my network. Therefor I did a lot of searching on this forum and the internet. Finally I installed PiVPN on the raspberry pi and used the wifi adres. Furthermore installed OpenVPN on the iPad and did some changes in the router. OpenVPN comes with an app and with the oven file created on the Pi I'm able to make the connection between the iPad and the raspberry pi.

So until here no issues although I have to admit it was a lot of reading, trying and following instruction without exactly understanding what I was doing. No worries passwords etc are secured so no open gates on router, iPad of pi.

I was wondering of there is a instruction, manual on setting this OpenVPN - PiVPN connection?
Because I'm now puzzling how to reach the SIP homepage on the raspberry pi via this connection. As mentioned I'm able to connect but I have no idea what the next step is.
Do I need to do something in the OpenVPN app on the iPad with proxy??????


best regards, Martin

Print this item

  Problem whit Paho mqtt
Posted by: DrLabel - 2024 Feb 25, 07:24 PM - Forum: Installation and set up questions - Replies (3)

after Google I get to this page :

https://stackoverflow.com/questions/7798...sion-error

I'm getting this error:
pi@sip-system:/opt/SIP $ python3 sip.py
fatal: detected dubious ownership in repository at '/opt/SIP'
To add an exception for this directory, call:

       git config --global --add safe.directory /opt/SIP
Could not use git to determine version! Command '['git', 'rev-list', '--count', 'HEAD']' returned non-zero exit status 128.
fatal: detected dubious ownership in repository at '/opt/SIP'
To add an exception for this directory, call:

       git config --global --add safe.directory /opt/SIP
Could not use git to determine date of last commit! Command '['git', 'log', '-1', '--format=%cd', '--date=short']' returned non-zero exit status 128.
MQTT publish UP
MQTT plugin couldn't initalize client: Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details
plugins loaded:
 mobile_app
 mqtt
 node_red
 plugin_manager
 relay_board
 system_update
 weather_level_adj
Starting timing loop

http://:::80/
Traceback (most recent call last):
 File "/opt/SIP/sip.py", line 334, in <module>
   app.run()
 File "/opt/SIP/sip.py", line 253, in run
   return web.httpserver.runsimple(func, (ip, port))
 File "/opt/SIP/web/httpserver.py", line 178, in runsimple
   server.start()
 File "/opt/SIP/cheroot/server.py", line 1849, in start
   self.prepare()
 File "/opt/SIP/cheroot/server.py", line 1804, in prepare
   raise socket.error(msg)
OSError: No socket could be created -- (('::', 80, 0, 0): [Errno 13] Permission denied)


The error form paho I fix like this:
python3 -m pip install "paho-mqtt<2.0.0"


But sip don't start

the logs at boot
Feb 25 19:43:09 sip-system sip[410]: Traceback (most recent call last):
Feb 25 19:43:09 sip-system sip[410]: File "/opt/SIP/sip.py", line 21, in <module>
Feb 25 19:43:09 sip-system sip[410]: import gv
Feb 25 19:43:09 sip-system sip[410]: File "/opt/SIP/gv.py", line 106, in <module>
Feb 25 19:43:09 sip-system sip[410]: from helpers import load_programs, station_names, days_since_epoch
Feb 25 19:43:09 sip-system sip[410]: File "/opt/SIP/helpers.py", line 21, in <module>
Feb 25 19:43:09 sip-system sip[410]: from gpio_pins import set_output
Feb 25 19:43:09 sip-system sip[410]: File "/opt/SIP/gpio_pins.py", line 36, in <module>
Feb 25 19:43:09 sip-system sip[410]: if gv.platform == "pi":
Feb 25 19:43:09 sip-system sip[410]: AttributeError: partially initialized module 'gv' has no attribute 'platform' (most likely due to a circular import)
Feb 25 19:43:09 sip-system systemd[1]: sip.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 19:43:09 sip-system systemd[1]: sip.service: Failed with result 'exit-code'.
Feb 25 19:43:09 sip-system systemd[1]: sip.service: Consumed 1.363s CPU time.
---------------------------------------------

Print this item

  Moisture Sensor Chart
Posted by: cdesouza - 2024 Feb 16, 01:06 PM - Forum: Writing plugins - Replies (4)

The purpose of this plugin is to display charts for the following data

  • moisture sensor data collected by the moisture_sensor_data_mqtt plugin
  • watering time (accumulated per day)

Sometime in the future I would also like to display charts for
  • temperature of my overwintering tent
  • water level in the water butt

I have played around with chart.js and have a rudimentary framework setup to configure and display charts:

   
   

I do however have some questions:
  1. I required chart.js and d2.js to be installed. I guess they should be installed under ./static/scripts. How will they be installed, via plugin manifest or will they come with the SIP installation?
  2. As far as I understand the chart.js documentation if I work with milliseconds I do not required a data adapter, however I could not get this to work so I would also required luxon.js and chartjs-adaptor-luxon. Again both in ./static/scripts. So the same question as for 1. applies.
  3. The moisture sensor data that I want to display is under ./data/moisture_sensor_data. This cannot be loaded via d3.js as it does not see this directory. Can this be changed or should the data be stored somewhere else?
  4. For the accumulated watering time I had planned to listen for the schedule completed signal and sum the schedule time for each station or is this information already available somewhere?  

I'm playing with the idea of turning this into a chart plugin that takes a sets of datasource/configuration and displays a chart for each.

Print this item

  Monthly Adjust per Station
Posted by: cdesouza - 2024 Jan 31, 10:42 AM - Forum: Writing plugins - Replies (17)

Hi,

I have more or less completed the third of the 4 plugins I had planned - as the name suggests it allows altering the water amount per station and per month.

   


I have a couple of issues though:

1. The value of the "station" argument does not seem to be correct for the signal "stations_scheduled" as it has the value "SIP" instead of the station number n:

Code:
def notify_station_completed(station, **kw):
    print(f"Station {station} run completd")

completed_signal = signal("station_completed")
completed_signal.connect(notify_station_completed)


def notify_stations_scheduled(station, **kw):
    print(f"Station {station} run scheduled")

scheduled_signal = signal("stations_scheduled")
scheduled_signal.connect(notify_stations_scheduled)


Output:
Station SIP run scheduled
Station 1 run completd


2. The plugin should not affect "Run Now" schedules i.e. schedule started due to manual actions. As is the case with the Moisture Sensor Control plugin however, there is no easy way to identify theses schedules

3. Not really a problem but an inconsistency. The duration for "Run Now" schedules is a float as opposed to an int for a schedule for automatically started programs
Code:
Run Now == Before [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [1706559510, 1706559540, 30.0, 3], [0, 0, 0, 0], [0, 0, 0, 0]]

Schedules === Before [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [1706559600, 1706559630, 30, 3], [0, 0, 0, 0], [0, 0, 0, 0]]

Print this item

  Problem with Run Once and Concurrent mode
Posted by: cdesouza - 2024 Jan 21, 07:07 PM - Forum: Report a problem - No Replies

Hi,

if there is a program running on station S1 and a Run Once is triggered on station S2 then the program on station S1 is terminated by the Run Once on station S2.

While this makes sense for sequential mode, it does not seem to make sense for concurrent mode as the stations should be able to run in parallel.

Print this item

  Problem with concurrent mode and overlapping programs
Posted by: cdesouza - 2024 Jan 21, 01:39 PM - Forum: Report a problem - Replies (1)

Hi,

I was experimenting with concurrent and sequential mode and work out that

  • for sequential mode the running program has precedence and will stop other programs from starting
  • for concurrent mode a scheduled program has precedence and will stop a running program, well sort of, see below

If this is the case then it would be good if it were documented in the Wiki.

And now to the well sort of bit, which I think is a bug. With the following setup:
  • SIP Version: 5.1.19
  • Mode: Concurrent
  • Prog1: S1, 09:00, 4 mins
  • Prog2: S1, 09:02, 6 mins 

I get the following results
  1. 09:00 Prog1 will start (as expected)
  2. 09:02 Prog2 will start, terminating Prog1 (as expected)
  3. 09:04 Prog2 will terminate (this is not expected)

The log entry is as follows: 
  • S1 04:00 67 % Prog2

I would have expected Prog2 to run until 09:08 and the following log entries
  • S1 02:00 50% Prog1
  • S1 06:00 100% Prog2

--Edit --
On a similar note with the following setup
  • Prog1: S1, 09:00, 6 mins
  • Prog2: S1, 09:02, 2 mins
Prog1 is terminated by Prog2 (09:02) and when Prog 2 ends (09:04) the UI show 00:00 until Prog 1 would have terminated (09:06)

Print this item

  Using moisture sensors to control programs
Posted by: cdesouza - 2023 Dec 28, 11:15 PM - Forum: Writing plugins - Replies (29)

Hi,

I have some Zigbee moisture sensors that I connect to my MQTT server using Zigbee2MQTT.

I would like to try and write a plugin that

  • Assigns a sensor to a station (via an MQTT topic?)
  • Allows the setting of a threshold moisture value per station
  • Suppresses any program from running for a station if the reported moisture value is higher than the threshold value
  • Shows if a program has been suppressed
  • Shows a graph of the moisture sensor values

Can someone please give me any pointers as to how to best to go about writing such a plugin?

Thanks in advance.

Print this item

  How to 'announce' a new plugin?
Posted by: I M - 2023 Dec 15, 09:59 PM - Forum: Writing plugins - Replies (3)

A couple of years ago a friend asked me to sort out a control system for his well; it would run dry under heavy use and require a trip out in order to reset once it had returned to normal levels - typically after an hour or so.

More recently a 'roundtuit' happened and I wrote a simple web-based control program for a Pi that would auto-reset the well controller via a relay after a user-specified period and display the pump status etc onscreen from opto-coupled inputs. The software also allowed for remote manual control of the well pump, all of which meant that the trek to the pumphouse would become a simple glance at a screen from wherever. A simpler and cheaper way to do it would have been to use an Arduino but I was thinking of the future as they have an elderly irrigation system...

After some trawling around the 'net for ideas on improving the latter I came across SIP and liked what I saw, not in the least that you're receptive to contributions, are maintaining the project well, and have developed quite a good ecosystem.

To that end I've written a plugin, presently entitled 'well' that displays the well pump motor status on the front page, along with timer detail (countdown of minutes) for controller reset if the well pump controller has shut off due to the well running dry. The time to reset is adjustable via the plugin menu, as are a couple of other parameters that should also allow the plugin to completely take over the task of well control should one wish to entrust it with your expensive well motor and pump...

It's working fine on the bench presently, and will hopefully be installed onsite within the next week or so. Following some insitu testing and cleanup of the code, and assuming it works as intended, I'd be happy to make the plugin available to anyone that might find it useful.

As such I've registered here so I could let you know about this and enquire as to whether this would fit within your vision for SIP? If so, and when I'm satisfied it's ok for release, I'd have thought the 'Announcement' section the right place to post a notice, however it didn't look as if one could start a new thread there? I guess that's by design, and clearly I'd go through the requisite protocol etc around reviewing the plugin first, but perhaps you could let me know where/how to make it public whenever it's ready?

Thanks.

Print this item