Skip to content

The program will not start from the command line or as a daemon #123

Description

@schnef

On a restart of the program, the program will fail with a number of rather confusing errors:

Error in MyConfig:init: While reading from '/home/pi/Pi-Somfy/operateShutters.conf' [line 130]: option '0x27962c' in section 'ShutterRollingCodes' al\
ready exists : myconfig.py:38                                                                                                                                                           
Error in MyConfig:ReadValue: Latitude: float() argument must be a string or a number, not 'list' : myconfig.py:159                                    
Error in MyConfig:ReadValue: Longitude: float() argument must be a string or a number, not 'list' : myconfig.py:159                                   
Error in MyConfig:ReadValue: SendRepeat: int() argument must be a string, a bytes-like object or a number, not 'list' : myconfig.py:164               
Error in MyConfig:ReadValue: UseHttps: 'list' object has no attribute 'lower' : myconfig.py:157                                                       
Error in MyConfig:ReadValue: HTTPPort: int() argument must be a string, a bytes-like object or a number, not 'list' : myconfig.py:164                 
Error in MyConfig:ReadValue: HTTPSPort: int() argument must be a string, a bytes-like object or a number, not 'list' : myconfig.py:164                
Error in MyConfig:ReadValue: TXGPIO: int() argument must be a string, a bytes-like object or a number, not 'list' : myconfig.py:164                   
Error in MyConfig:ReadValue: MQTT_Port: int() argument must be a string, a bytes-like object or a number, not 'list' : myconfig.py:164                
Error in MyConfig:ReadValue: EnableDiscovery: 'list' object has no attribute 'lower' : myconfig.py:157                                                
Missing config file or config file entries in Section Shutters for key 0x279621: 'list' object has no attribute 'split' : myconfig.py:79              
Failure to load configuration parameters                    

Problem:

The shutters are registered as an uppercase hexadecimal number.

[Shutters]
0x27962C = c,True,2

However, on writing the rolling code back to the config file, the uppercase hexadecimal shutter id is written as a lowercase hexadecimal number.

0x27962c = 24

On registering a shutter, the shutter id is formatted with the following line (mywebserver.py:188):

id = "0x%0.2X" % tmp_id

This will format the id as a Uppercase hexadecimal number. Probably, this should be changed into

id = "0x%0.2x" % tmp_id

FIX

Besides fixing the formatting in nywebserver.py, for existing shutter ids, edit the operateShutters.conf file and make the shutter ids lowercase in the sections [Shutters], [ShutterRollingCodes] and [ShutterIntermediatePositions] and restart.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions