Closed alonrab closed 5 years ago
Can you attach a screenshot of your Config -> Configure -> Raspberry Pi page?
Can you also attach your setup.log?
uninstalling pigpiod at config-config-raspberry pi with Configure pigpiod and install again with
sudo apt-get install pigpio python-pigpio python3-pigpio
improved the outcome, output torn on (green)
but % is off (input was 50%)
From your setup.log it doesn't seem as though this is a fresh install of Raspbian you installed Mycodo on. Let me know if this is not true.
maybe I am doing the fresh install wrong? Did today: Format, install pi, set up raspi config (vnc, i2c, wifi, expand memory), install mycodo, reboot
That is correct. I just needed verification. Try this command:
sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh install-pigpiod
Then reboot. That should get it working. This I believe is the issue, that this command is missing from setup.sh
I found the actual issue. pigpiod is not supposed to install at startup, but rather be a dependency for the PWM Output. When the PWM Output (or any of the Inputs that use pigpiod) is attempted to be added, the dependency system should install pigpiod for the first time. I just pushed a fix that will be incorporated into the 7.1.6 release.
An easy workaround for now is to just install a DHT22 Input before trying to install a PWM Output. The dependency system will install pigpiod for the DHT22.
did install + reboot. There are no error in log but no PWM. Just saw your note, thank you very very much! this is great! will look into this as I'm not familiar with DHT22 but need to resume this later on tonight, best,
Your messing with pigpiod outside Mycodo may have affected it's ability to install pigpiod internally through Mycodo.
I also noticed you are using a hardware PWM pin but don't have the Hardware Pin Library selected in the Output options. Read the PWM section of the manual for explanations of this.
Are you using the same pin to measure PWM on the same pin you are generating the PWM signal? If so, I'm not sure if this will yield good results. I would measure the PWM signal on a separate pin than the PWM signal is being generated. A better option would be to use an oscilloscope.
FYI, these are the Inputs that have pigpio as a dependency and it should have been installed when any of the following Inputs were installed: DHT11, DHT22, HTU21D, Signal: PWM, Signal: Revolutions
Thanks for the updated version, worked after running the command sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh install-pigpiod Did fresh install and set up again. this is what i found: step 1. Adding output PWM at GPIO pin 19 at 50% - same problem in deamon log , cant find pigpio step2: Delete output, add sensor DHT22 at GPIO 4; check deamon log, can't find pigpio step3: run command: sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh install-pigpiod as the end of installation notes prompted a warning run command: udo systemctl daemon-reload Add PWM output, GPIO 19, 50% and turn on power output steady at 1.52V seems to be resolved Thanks
Okay, I think I finally fixed the issue. The fix I just pushed should now allow it to detect the missing pigpio dependency from a fresh install when a PWM output or an Input that requires pigpiod is attempted to be installed.
Hi, Tried today again with fresh install with version 7.1.7 Had the same problem with adding the PWM GPIO output for adding GPIO PWM output ,cant find pigpiod checked that it was installed and it was (zero updates installed) Deamon Log:
File "/var/mycodo-root/mycodo/mycodo_daemon.py", line 919, in output_on trigger_conditionals=trigger_conditionals) File "/var/mycodo-root/mycodo/controller_output.py", line 450, in output_on_off self.output_switch(output_id, 'on', duty_cycle=duty_cycle) File "/var/mycodo-root/mycodo/controller_output.py", line 616, in output_switch self.pwm_hertz[output_id]) File "/usr/lib/python3/dist-packages/pigpio.py", line 1542, in set_PWM_frequency _pigpio_command(self.sl, _PI_CMD_PFS, user_gpio, frequency)) File "/usr/lib/python3/dist-packages/pigpio.py", line 983, in _pigpio_command sl.s.send(struct.pack('IIII', cmd, p1, p2, 0)) AttributeError: 'NoneType' object has no attribute 'send' 2019-02-04 12:47:35,702 - mycodo.output - ERROR - Cound not connect to pigpiod 2019-02-04 12:47:35,705 - mycodo.output - INFO - PWM 1feb705b setup on pin 21 2019-02-04 12:47:35,959 - mycodo.output - ERROR - Cound not connect to pigpiod 2019-02-04 12:47:35,960 - mycodo.output - INFO - PWM 1feb705b setup on pin 21 2019-02-04 12:47:44,810 - mycodo.daemon - ERROR - Could not turn output on: 'NoneType' object has no attribute 'send' Traceback (most recent call last): File "/var/mycodo-root/mycodo/mycodo_daemon.py", line 919, in output_on trigger_conditionals=trigger_conditionals) File "/var/mycodo-root/mycodo/controller_output.py", line 450, in output_on_off self.output_switch(output_id, 'on', duty_cycle=duty_cycle) File "/var/mycodo-root/mycodo/controller_output.py", line 616, in output_switch self.pwm_hertz[output_id]) File "/usr/lib/python3/dist-packages/pigpio.py", line 1542, in set_PWM_frequency _pigpio_command(self.sl, _PI_CMD_PFS, user_gpio, frequency)) File "/usr/lib/python3/dist-packages/pigpio.py", line 983, in _pigpio_command sl.s.send(struct.pack('IIII', cmd, p1, p2, 0)) AttributeError: 'NoneType' object has no attribute 'send' 2019-02-04 12:51:12,106 - mycodo.output - ERROR - Cound not connect to pigpiod 2019-02-04 12:51:12,107 - mycodo.output - INFO - PWM cdbdddc8 setup on pin 21
Thanks for the update. I'll do another fresh install later so we can finally lay this bug to rest.
Did it prompt you to install pigpio via the dependency page when you attempted to add the PWM Output?
Report all dependencies for PWM were installed Device: SIGNAL_PWM (Signal (PWM)) All dependencies have been installed for this device.
That doesn't tell me if pigpio was a dependency that was installed.
Ok, this is what I obseved wen adding a new PWM output:
There was no prompt to install any need install dependency When I checked if pigpiod is installed it was already installed. It worked for version 1.6
P.S, Was in the process of doulble chek it wasn't my mistake, but in V 7.1.6 the GPIO PWM worked but when turning more then one power GPIO pins on all power outputs (3.3v) went out (no V out ) although system stated they were on. Now GPIO power are all working but cn't generate PWM. I tested my Pi device to make sure it is not faulty by turning all pins on with a separate python code All test were done before fresh install to make sure there is no conflict hope it make sense and let me know if pulling any log file can help?
It indicating the PWM is on when there was an error preventing it is a bug. Pushing a fix for that.
My previous question seems like it was answered, but it's not clear that it was. When you first attempted to add a PWM Output, there are two scenarios that could have occurred immediately following clicking "Add" on the Output page:
ok thanks!
Keep in mind this fix does not resolve the issue, it merely doesn't allow the output to show that it's been turned on when that error occurs. My question is still unanswered from comment https://github.com/kizniche/Mycodo/issues/617#issuecomment-460394125
Is this about the dependency prompt? clarify: there was no prompt to install dependency or any prompt to install/update I was not taken to install/ scenario 2
I finally fixed this issue and released v7.2.0. Let me know if there are any issues.
Hi, Did fresh install today (format;install - on other installs) no luck with PWM GPIO see 1) deamon report; 2) setup.log
1) deamon report:
Edit: log deleted by @kizniche because it's way to large to be here. If wanting to share logs in the future, attach them as a file.
Tried adding DHT22 input and turning on, no error, but did not improved outcome for adding PWM
You were not redirected to the dependency page and prompted to install pigpio when you attempted to create a PWM output?
I tested this last night and it worked for me. I will do one more fresh install and see if I can replicate the behavior.
Funny, I was directed as described to install dependencies when I installed atlas pH input, no such redirection for the PWM
The Atlas pH Input has a dependency, but not pigpio.
Many Inputs have dependencies. This wasn't an issue with the dependency system as a whole, only adding Outputs. However, you indicating the pigpio dependency for the DHT22 wasn't installed when you attempted to install that Input is concerning.
yes, no error was raised for DHT22 in log.
That's not what I was suggesting. Disregard the log. When you add an Input that has a dependency, and that dependency isn't already installed, it should prompt you to install that dependency via the dependency page. If, when attempting to install the DHT22, it did not prompt you to install the pigpio dependency, then it indicates the issue is beyond merely the Output Dependency issue I described.
Which Raspbian version are you installing? I suspect you are not using the Lite version and this is the source of your issues, as python3-pigpio is coming pre-installed and that is indicating to Mycodo that it doesn't need to install its own scripts.
That is correct. I am not using the Lite version. This is probably why i encounter some difficulties. Did not know, thanks for pointing this - really wasn't aware they are so different.
I just released v7.2.1. I think I came up with a solution that works for both the Lite and non-Lite version of Raspbian, however I've only tested on the Lite version. If you're inclined to test, please let me know if it works.
Of course, will update what i find shortly
I think it is working as intended - Many thanks! Did upgrade to v 7.2.1, add GPIO PWM was prompted to install the dependency after install, had to reboot -then adding GPIO, set up PWM and turn PWM % on were ok without error report.
I'm away from the lab but will report if the output volt test is wrong - think its probably ok. Best,
Thanks for the help. I'm going to consider this closed. If you find an issue, we can reopen it.
Mycodo Issue Report:
Specific Mycodo Version: ver. 7.15 on Pi3B v 1.2
Problem Description
Hi All, I'm not sure what is causing this and would like to see if you have any advise? Trying to set up PWM to new pump controller (4-20 ma) with 0-3.3v signal (through noyito voltage to current convertor) When I add PWM output to pin 18 and turn on there is an error - cant find pigpio. Did fresh install and still happens When I put: sudo pigpiod in command port it works Any suggestions to solve this?
what were you trying to do
specific setup details that are involved
Errors
step2: set % and turn on
test error log: deamon,![image](https://user-images.githubusercontent.com/29787500/52001369-3e8e1b80-248d-11e9-8b1a-142bc70a5080.png)
step 3: in command port sudo pigpiod![image](https://user-images.githubusercontent.com/29787500/52001294-0edf1380-248d-11e9-98ed-5abbcde49d4b.png)
step 4: turn output on again with 50%![image](https://user-images.githubusercontent.com/29787500/52001558-b4928280-248d-11e9-9525-43b38182306d.png)
random output that turn off after a few seconds.
For pin 18 the output turned green (on) but same problems accrue
Fool error tests: tested that PWM work: python code:
import RPi.GPIO as IO #calling header file which helps us use GPIO’s of PI
import time #calling time to provide delays in program
IO.setwarnings(False) #do not show any warnings
IO.setmode (IO.BCM) #we are programming the GPIO by BCM pin numbers. (PIN35 as ‘GPIO19’)
IO.setup(19,IO.OUT) # initialize GPIO19 as an output.
p = IO.PWM(19,22000) #GPIO19 as PWM output, with 100Hz frequency p.start(50) #generate PWM signal with 0% duty cycle
yielded the expected 1.62vdc at GPIO pin 19
Any suggestions? many thanks!
Steps to Reproduce the issue:
How can this issue be reproduced?
Additional Notes
Is there anything that should be added to make it easier to address this issue?