Forum Replies Created
-
AuthorPosts
-
djagerifParticipantI thought of that but being a .NET programmer I didn’t really know. Let’s see if a Python guru can suggest something that will work better.
PS. It actually works with the testing I did.
djagerifParticipantOk, seeing that I didn’t get any response I went ahead and did my own thing. For starters I modified the ospi.py program to look for a file called custom.py, if found then it imports the classes from that file and also loads a different ‘urls’ declaration. If the file doesn’t exist then it loads the standard ‘urls’ definition and everything is as per normal.
With the custom file I can add my own stuff to enhance the interval program without messing with the original program. Here are my changes for anyone interested.
PS. I am sure there are better ways of doing it but hey, no one offered any advice.
Just below the import statement I added the following and deleted the original ‘urls’ command.
#### Load Custom Import file if it exists ####
try:
with open('./custom.py'):
import custom
urls = (
'/', 'home',
'/cv', 'change_values',
'/vo', 'view_options',
'/co', 'change_options',
'/vs', 'view_stations',
'/cs', 'change_stations', # name and master
'/sn(d+?Z)', 'get_station', # regular expression, accepts any station number
'/sn(d+?=d(&t=d+?Z)?)', 'set_station', # regular expression, accepts any digits
'/vr', 'view_runonce',
'/cr', 'change_runonce',
'/vp', 'view_programs',
'/mp', 'modify_program', # open 'Modify program' window
'/cp', 'change_program',
'/dp', 'delete_program',
'/gp', 'graph_programs',
'/vl', 'view_log',
'/cl', 'clear_log',
'/lo', 'log_options',
'/c1', 'custom.custom_1', # Custom function 1
'/c2', 'custom.custom_2', # Custom function 2
'/c3', 'custom.custom_3', # Custom function 3
)
except IOError:
print 'Custom Imports not found.'
urls = (
'/', 'home',
'/cv', 'change_values',
'/vo', 'view_options',
'/co', 'change_options',
'/vs', 'view_stations',
'/cs', 'change_stations', # name and master
'/sn(d+?Z)', 'get_station', # regular expression, accepts any station number
'/sn(d+?=d(&t=d+?Z)?)', 'set_station', # regular expression, accepts any digits
'/vr', 'view_runonce',
'/cr', 'change_runonce',
'/vp', 'view_programs',
'/mp', 'modify_program', # open 'Modify program' window
'/cp', 'change_program',
'/dp', 'delete_program',
'/gp', 'graph_programs',
'/vl', 'view_log',
'/cl', 'clear_log',
'/lo', 'log_options',
)
Then I created a custom.py file containing my code I wish to add. Here is a sample
#!/usr/bin/python
"""Updated 01/07/2013."""
import ospi
class custom_1:
"""View all the options above and also station names."""
def GET(self):
custpg = 'n'
custpg += 'n'
custpg += 'n'
custpg += 'n'
return custpg
class custom_2:
""" Custom Script 2 """
def GET(self):
custpg = 'n'
#Insert Custom Code here.
return custpg
class custom_3:
""" Custom Script 3 """
def GET(self):
custpg = 'n'
#Insert Custom Code here.
return custpg
djagerifParticipantHave you considered supporting OS V2.0? I read somewhere that is supports 5 expansion boards by default (48 Zones). Perhaps there is a way to ‘determine’ if the OS firmware is V1.8 or V2.0 and dynamically update the settings page.
If however it cannot be done then set the max expansions to 5 because when written back to OS 1.8 it will only set it internally to 3.
Ingo
djagerifParticipantIt’s just what OS uses instead of a space. It uses either a ‘,’ or ‘+’ character. Hover your mouse over the OS ‘Location’ text.
Works perfectly now, thanks.
djagerifParticipantI just updated again but it doesn’t save the + character.
djagerifParticipantJust a small issue: The OS ‘Weather’ link doesn’t work when the location textbox contains a space, even though it saves it. The OS documentation says you need to use a [,] or [+] instead of a [space]. Can the Web App also allow both these values to be used/saved?
djagerifParticipantI already rooted my HTC to ICS but went back to stock OS. The issue with this old device is of storage, there was no real benefit having the capability to load new applications but no space to install them on.
Don’t worry about my old 2.3 OS, my contract expires soon and then I can upgrade.
One more for the Wish List: Could you please add a Program Export/Import or Backup/Restore function. If you have to restore OS then perhaps via your application you can dump all the settings on OS if possible. If it’s in XML format it would be easy to edit and modify the file if you choose.
Ingo
djagerifParticipantI am now officially impressed. All changes work perfectly. I also changed my Initial TZ to one of the supported PHP ones and it works great.
Something for the “Wish List”
1. Have an option to clear the configuration so the next restart will bring you back to the initial install screen if you really messed things up.
2. Clear Log option.Great app but unfortunately doesn’t work with my old HTC Desire on Android 2.3. Could you perhaps publish a minimum spec to the community as well? I fear my old HTC has an older IE based browser which I noticed in an earlier post have similar issues. The top is cut off and in my case I can’t scroll up or down.
Ingo
djagerifParticipantNice!!!
How about a check on startup, if there is a new version on the net then popup a message informing the user a new version is available.
Ingo
djagerifParticipantYip, that seems to do the trick. In Manual Mode it doesn’t refresh properly. Just pressing the Browser Refresh loads the right name.
Just a question for Updating. I use RPI as my web server. What is the easiest to get updates pulled down to my server without affecting my configuration settings?
Ingo
djagerifParticipantI installed your application and it (almost) worked first time. My settings didn’t save due to my hostname not resolving. Once I put in the correct hostname, with domain, it saved my settings.
Just one request. I see that US/Central is the default Timezone. What is the significance of this as I left it at default and when I ran the application it picked up my local GMT+2 Timezone automatically. If it has significance, can we not have a dropdown list of all the available timezones?
I also found my Location not being read correctly from OS. I have ‘Irene,South+Africa’ configured and it only displays ‘Irene’ in the MobileWeb app.
Oops, one more ‘bug’. I set my ‘S32’ name to ‘Station32’. When I check the Settings page it displays ‘Station32’ but when I go to Manual Control it displays ‘Station31’
Other than that, it works like a charm.
Thanks,
Ingo
djagerifParticipantThanks.
djagerifParticipantI Like !!!
Any chance of a future Android version?
djagerifParticipantPerhaps it lost it’s IP address, use B1 to check it.
djagerifParticipantSo it is, I activated the Rain Sensor setting in the Options screen and voila, both are visible on the LCD.
djagerifParticipantI had a few bytes of memory left so I put something in to display Manual Mode on the LCD. See picture attached. I don’t know if I broke something else but that’s why I got this – to toy around. If there was a bit more space you could display “D” for Rain Delay Active and even “S” for Rain Sensed.
Ingo
djagerifParticipantI can’t wait…..
djagerifParticipantThanks for the feedback. I did also check the RAM usage and it’s pretty close to max. I think you guys did a good job of squeezing every ounce of functionality out of limited flash and memory. Can you give us any indication what V2.0 will have for us? Some Tech-Specs would be nice.
djagerifParticipantI thought it was a formatter of some sorts but wasn’t sure. I’ll look through their documentation for some pointers.
Ingo
djagerifParticipantI converted the VirtualBox image to VMWare using the following URL and it seems to be working perfectly.
djagerifParticipantThat’s great, thanks. How about creating one for VMWare so users can run it inside VMPlayer?
Ingo
djagerifParticipantOr even just a popup message as soon as you enter a value that will conflict with another. This way you are notified immediatly of an overlap and can adjust your times accordingly. I like the Global View also.
Ingo
djagerifParticipantMy requirements are on a much smaller scale. Basically my Winter schedule just requires less water at a different time during the day – I hate to burn my grass due to the water freezing.
I too have created multiple programs but I must now just remember to manually switch them over at some point.
Ingo
djagerifParticipantOops… I missed the commands in the PDF file. Thanks for pointing me in the right direction.
Ingo
djagerifParticipantI second that request. Perhaps also add a remote command to ‘Enable/Stop Operation’ via HTTP or whatever future integration options will be available.
Ingo
-
AuthorPosts