June 25, 2015 at 5:28 pm #38717
I just brought my OSBo firmware up to the unified 2.1.5 and it is working very well. So now it’s time for me to start mucking around and break a few things.
First, a question: In the web interface, is there a way to access the mini-relay?
Second, a request: Part of the reason for going with OS was to be able to add on some functionality. On my ‘to do’ list is to add a local temperature sensor, attach a relay board, add a garage door sensor, and some messaging capability. I started working to add some functionality to the Python code, but now need to start over with the unified firmware. An example for how to extending the current code to access the additional interface pins on the BBB would be very useful. Even some pointers on which parts of the code need to be edited would be helpful. Or is it better to write some separate, independent code to do these other functions?June 25, 2015 at 6:55 pm #38721
After reading in the OSPi forum, I think I will try writing some separate code and interface to the OS firmware through the API with web calls to the localhost.
Does this sound correct, or is there a better way to integrate other functionality of the BBB with the OS firmware?June 25, 2015 at 7:58 pm #38726
Support for mini-relay has been discontinued (in both hardware and software) since earlier this year. If you want to use a relay with OpenSprinkler you can wire a 24VAC relay just like a standard sprinkler valve (see the blog post below about available 24VAC relay options)
The unified firmware is written in C++ to maintain maximal compatibility with the microcontroller-based OpenSprinkler. If you are familiar with C/C++ I think it’s not too difficult to go through the code and find out where to add additional code. For example, if you want to add an additional sensor, you can follow how rain sensor is implemented as an example. We should probably document this somewhere, but the source code is basically partitioned as follows:
– defines.h: global macro defines, options, GPIO pin definitions
– OpenSprinkler.h/.cpp: functions / data structures that are relevant to the basic / low-level operations, such as loading/saving options, station attributes, controller status variables
– main.cpp: this is where the main loop is defined, which is in charge of scheduling of sprinkler stations, handling of log, time keeping and so on.
– weather.h/.cpp: initiate weather queries and handling query results
– program.h/.cpp: data structure for sprinkler programs.
- You must be logged in to reply to this topic.