Mycroft Community Forum

Picroft installation and setting server timezone

I’ve noticed that when I install the Picroft images they do not request or set the timezone of the OS to your local timezone. I think this should be set as it would allow date/time libraries built into Python and other coding environments to properly handle local timezone conversions as opposed to skill developers having to roll out their own functions or adding complexities when manipulating times and dates. (I’m running into this issue now while trying to tweak the weather skill to report the sunrise/sunset times correctly).

For now i manually went ahead and updated the server using timedatectl set-timezone 'America/Chicago' for my instance.

Sorry if I prematurely posted my own tweak before looking at other commits. Its only been a couple of days since I started diving into picroft and still getting a handle on this awesome project.

I used the official guide (Picroft - Mycroft AI) to install image and run through the setup but completely neglected to run raspi-config afterwards to set the local timezone/locale/etc. :man_facepalming: :man_facepalming: Silly Me!!!.

Maybe we’re talking past each other. There is indeed a problem in the weather skill to wrongly adding the UTC delta (tz-aware timestamp is treated as naive) that hasn’t been adressed yet (as far as i can see)

So, sunrise/sunset shouldn’t work no matter what. This was just to raise awareness. (and give you a hint how to fix skill-weather)

Hey I just had a dig into this further and pushed a fix to the Skill.

The problem was that datetime.fromtimestamp() tries to return a local datetime object but doesn’t include the tzinfo on it, even if you use the tz argument.

Let me know if you have further issues with it.

Workable solution. But at that point in time i made the changes i’d bet my hack was working. I delete my post above to not cause confusion. (rebase it anyway)

Seems something weird is going on. I can see the changes you made on git for the datetime issue as well as the sunset dialog bug fix but mycroft didnt pick up the change new changes. So I removed the skill manually using mycroft-msm remove weather and then reran mycroft-msm install weather. It installs but appears to still be pulling the older version. If i do a git clone it does pull the latest with the revisions but running it via mycroft-msm or even using the web UI to download it as a custom skill is still pulling the older revision that contains the issues prior to your fix last night. I can directly clone the weather skill into the skills folder in picroft and it appears to load fine but trying to follow the the official route to keep the install as clean as possible.

Could this be a local caching issue using mycroft-msm?

mycroft-msm install

Tried that as well (after uninstalling weather first of course). No luck. git clone however seems to work just fine if I clone it into /opt/mycroft/skills

msm restricts marketplace skills to a certain version (based on the branch your core running with?). Little unclear about the second statement.

But what’s definetly working is if you fork it and install it from there. (i wouldn’t know how good msm handles the git clone thing - without itself initializing it :wink: )

Im on 21.2.1.

I was really surprised about how mycroft reinitalizes the Skills also as I could in real time update skills (Im currently building one to handle my switches via MQTT) and it seems to surprisingly work well :smiley:.

Nevertheless, before updating weather, I tried:
mycroft-msm remove weather
mycroft-msm install weather.

Yeah it uses git submodules - so the Marketplace points at a specific commit in the Skill repo. This means JohnDoe can’t submit a funny Skill that gets installed on a bunch of devices and then update it to install a bitcoin miner.

Well - they can do the update in their repo but it will get reviewed by us before it gets updated in the Marketplace, and we’d obviously not allow that.

You can do a git pull in a Skills directory to update it to the latest from that branch eg:

cd /opt/mycroft/skills/mycroft-weather.mycroftai
git pull

Or you can say “Hey Mycroft, install beta weather skill” and it will do that for you

Cloning the repo like you’ve suggested also works

Yep there are different versions of a Skill pinned for different versions of mycroft-core because the code in core changes over time. So you should be able to install mycroft-core v19.8 and MSM will install the Skills that are compatible with that version of core.