Open Jesstr8803 opened 2 years ago
@Jesstr8803 Thanks for the report.
If the pisugar2 rtc keep reporting lots of xx
s, that means the hardware has some problem, please contact pisugar.zero
The error in /etc/default/pisugar-server
had been fixed in the latest development build, you could install the latest one and test again.
@fengyc Thanks for getting back to me, I was able to try 1.6.4 and that version seemed to fix the /etc/default/pisugar-server and the web authorization login. But I am still having issues with the date reporting back correctly with the rtc_alarms. I have contacted the email provided. Thank you fengyc. I also have a couple more boards on order, ,so when I recieve them I can do more testing!
@fengyc I have contacted the email provided, and they said that having the XX in the RTC is ok and it should not affect the function of the RTC as the important information is at the top of the register. Looking forward to the next update, hopefully you can figure out the date issue with the alarms!
Could you update the rtc and set up a wake up alarm via web ui ?
rtc_alarm_time: 1999-12-31T17:00:00-07:00
is UTC 2000-01-01T00:00:00
, the pisugar-server would return this value if the data of rtc is incorrect.
@fengyc, I can set the time correctly from both the Web UI and using the socket. But the date still comes back incorrectly.
pi@DropCam:~ $ sudo nc -U /tmp/pisugar-server.sock
get rtc_alarm_time
rtc_alarm_time: 2000-01-01T13:47:00-07:00
rtc_alarm_set 2021-12-31T13:48:00-07:00 127
rtc_alarm_set: done
get rtc_alarm_time
rtc_alarm_time: 2000-01-01T13:48:00-07:00
eg.
get rtc_alarm_time
rtc_alarm_time: 2000-01-01T13:51:00-07:00
@Jesstr8803 The rtc_alarm_time value is correct. Only the hh:MM:ss and the weekday repeat values could control the rtc alarm, the yyyy/mm/dd part of rtc_alarm_time would be ignored.
@fengyc, Sorry for taking so long to get back, Thanks for all your help! Just out of curiosity, did the date report correctly in a previous version? maybe 1.5?
@Jesstr8803 No.
My plan is to add a new feature to allow setting the year and month of the alarm datetime, but I am not sure whether the RTC chip could support this feature. Will update the code if I make it work.
Environment
To Reproduce Steps to reproduce the behavior: After installing 1.5.0 of piserver using curl http://cdn.pisugar.com/release/Pisugar-power-manager.sh | sudo bash The battery seems to communicated fine with raspberry pi, can request any battery flag using nc -U /tmp/pisugar-server.sock and then typing in a request. But the RTC return nothing but Invalid request.
Expected behavior Should be able to request data from RTC
Screenshots If applicable, add screenshots to help explain your problem.
Additional context I2C tools shows both i2c addresses.
I tried using all the different versions of PiSugar server/power manager from 1.5.0 to 1.6.3, they all gave different results, I could almost make it work with 1.6.3, but I would have to go back and manually configure /etc/defaults/pisugar-server, and /etc/pisugar-server/config.json, as the default file was messed up because of the OSD menu(not actually sure what it is called, but it's the blue screen) that asks about the type of PiSugar, and the login for the config.json was messed up, the user would say OK, I'm thinking its becasue of the OSD menu. But when I did this I could communicate with the RTC, but the behaviour wasn't right either. When setting the alarm the time would populate correctly but the date would always have the year 2020 or 1999. I also tried installing 1.6.3 then down grading to 1.5, and it would work better the dates would still be messed up.
Not sure what is causing the breakdown, In the meantime ive gone back to using a Pi Zero. I would love to be able to use my Pi Zero 2 as it is much faster, although a little more power hungry. But for my application which is a long duration timelapse, I need to be able to boot fast take a picture and and shutdown fast. then wait until the next photo to start the cycle again.
Update: I started a new install of Buster on the Zero 2, and installed PiSugar software using : wget http://cdn.pisugar.com/release/pisugar-power-manager.sh sudo bash pisugar-power-manager.sh -c release
Installed version 1.6.3, like I stated earlier it would mess up the config.json and deafult/pisugar-server file. Below is what it reports:
Config.JSON - think it's pulling info from the OSD for the auth. I usually change it back to admin, admin. Or as you see later I'll just disabled it.
This is the contents of the /etc/default.pisugar-server file
OPTS=--config config.json --model '20 Unsupported command "/usr/bin/raspi-config" (full line was "/usr/bin/raspi-config") received from confmodule.' --tcp PiSugar 2 (2-LEDs):8423 --uds /tmp/pisugar-server.sock
So I cahnged it to:
OPTS="--model 'PiSugar 2 (2-LEDs)' --syslog --config config.json --uds /tmp/pisugar-server.sock --tcp 0.0.0.0:8423 --ws 0.0.0.0:8422 --web /usr/share/pisugar-server/web --http 0.0.0.0:8421"
After fixing up these files I'll send the following to disable the auth :
echo "set_auth" | nc -q 0 127.0.0.1 8423
And as you can see it is working. Well mostly, there seems to be an issue with the alarm date, but the RTC will communicate now.
Here you can see that the alarm set is accepted but when reported back the date is wrong:
Hope this helps you guys!