Menu

#1 Permission problem / DB control point status

1.0
open
None
2016-11-10
2016-01-28
alpenboy
No

First let me send you a big Thank you for this great application!
I installed it on a raspberry pi B with the new bticino basic gateway F455 (much cheaper than the other options) and it was really easy - even for me with my basic knowledge of linux.

However I found to have a problem:
- When I first set all my control points in the web setup it correctly detected that one of them was turned on (living room ceiling light). All others were off.
- Somehow this setting of the living room ceiling light is now stored permanently. Even when I click it it doesn't change the information (although it does send the right commands to the gateway and the lights are actually turned on/off). Also all the other lights information is remaining to this first setting (which was OFF)
- I entered the database with phpliteadmin and there I found the problem: obviously the set status in the rows cannot be changed. The living room ceiling light is the only one with status "1", all other are "0". However, if I try to edit it I get the alert: "ERROR: attempt to write a readonly database".
- But I can still add and delete control points over the web setup and turn them on/off, I just can't alter the status setting in the database when clicking on the web app... is there a permission problem?

Discussion

  • alpenboy

    alpenboy - 2016-02-06

    Now I could further identify the problem:
    - when I restart grasshopper it will correctly identify the status settings.
    - the first device connecting can change the status correctly.
    - all other devices connecting afterwards can change the status, but it will still display the one set by the first device.
    - so I assume it is a permission problem when several devices are connecting.

     
  • Michael Horvath

    Michael Horvath - 2016-11-10

    HI! Unfortunately grasshopper v5 looks a bit unfinished in points - like your mentioned update of the status and the integration of alarm systems and my best guess is they quit development.

    i had a look into the status problem and i think its because they left an old version in there... it uses mysql, which is not installed and a different database name.

    so what i did was install termsql (details how to do that on their github https://github.com/tobimensch/termsql) and then changed the contents of /var/www/exec/import_status/preparedb.sh to

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    #!/bin/bash
    python /var/www/exec/monitor/SendCommand.py '*#1*0##' >/var/www/exec/import_status/lightstatus.txt
    sed -i 's/*/,/g' /var/www/exec/import_status/lightstatus.txt
    sed -i 's/^,//g' /var/www/exec/import_status/lightstatus.txt
    sed -i 's/##/,,/g' /var/www/exec/import_status/lightstatus.txt
    sed -i '1 i\btgroup,status,btaddress,timestp,ownframe' /var/www/exec/import_status/lightstatus.txt
    
    #sqlite3 /var/www/db/grasshopper.sqlite </var/www/exec/import_status/lightstatus.sql
    termsql -i /var/www/exec/import_status/lightstatus.txt -1 --csv -t pointstatus -o /var/www/db/grasshopper.sqlite
    
    #mysql --local-infile=1 -u root --database=domotica --verbose </var/www/exec/import_status/lightstatus.sql
    

    Let me know if it works for you - its was just a quick shot (i dont own a bticino myself yet and just tested this at a friends house for 10 minutes - there it worked). if you need any help let me know.

     

    Last edit: Michael Horvath 2016-11-10

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.