Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
schnef opened this issue Aug 2, 2021 · 2 comments
Open

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

schnef opened this issue Aug 2, 2021 · 2 comments

Comments

@schnef
Copy link

schnef commented Aug 2, 2021

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.

@firewiremb
Copy link
Contributor

This problem almost left me desperate while setting up the installation in my house. I think it would be good if you created a pull request to fix the problem in the code.

@Nickduino
Copy link
Owner

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

It happens infrequently but that's not the normal behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants