nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 3, 2022 18:53:23 GMT -8
Trace of error that occurs after starting SkyWeather2.py is:
File "SkyWeather2.py", line 34, in module import wirelessSensors File "/home/pi/SDL_Pi_SkyWeather2/wirelessSensors.py", line 26, in module import aqi ModuleNotfoundError: No module named 'aqi'
I have completed basic setup and tests to this point. Camera and wired AQ sensor test ok, as do the WeatherRack and the indoor/outdoor temp/humidity sensor.
Suggestions?
|
|
|
Post by doxidad on Jan 4, 2022 5:22:39 GMT -8
You need to install python-aqi
sudo pip3 install python-aqi
Also
sudo pip3 install ffmpeg
Look in the README.md file in the SDL_Pi_SkyWeather2 directory
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 4, 2022 8:36:23 GMT -8
Hi doxidad, I applied both commands and rebooted. Same error occurs. Is there more to installing those modules than simply running the install commands as specified? Also, based on the README, I attempted the install of mysql that is described above the two that you described. Those commands error on "no such option -u". Tx, Robert
|
|
|
Post by doxidad on Jan 4, 2022 9:32:58 GMT -8
The 2 commands do the proper install with nothing else for you to do. (you do need the sudo part of the command or they may not install properly).
Do you have the SD card from SwitchDoc? If you do, mysql should be installed with the databases created. The 2 lines that have you update the mysql databases are just updates to the supplied databases.
If you don't have the SD card there will be a number of things that need to be installed for SkyWeather2 to work. There are some topics here that specify what needs to be installed.
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 4, 2022 10:01:21 GMT -8
I copy/pasted the commands, including sudo. I will walk back thru the steps I've already performed, as I'm puzzled about the error continuing after the two installs. Trying to identify something I might have missed.
I do have the SDL SD card. Performed several software update steps on it during the setup process.
Tx, Robert
|
|
|
Post by SDL on Jan 4, 2022 14:10:09 GMT -8
Would you post the first 30 lines of /home/pi/SDL_Pi_SkyWeather2/wirelessSensors.py
Something is wrong.
BP
|
|
|
Post by Jason on Jan 4, 2022 16:54:23 GMT -8
Can you confirm you are launching SkyWeather2.py using the command sudo python3 SkyWeather2.py?
Thanks,
Jason
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 5, 2022 7:22:07 GMT -8
@jason, yes I am launching via the specified command.
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 5, 2022 7:25:47 GMT -8
@sdl, here is the first screen full from wirelessSensors.py
pi@SkyWeather2:~/SDL_Pi_SkyWeather2 $ cat wirelessSensors.py # # wireless sensor routines
import util import config
import json import random
import sys from subprocess import PIPE, Popen, STDOUT from threading import Thread #import json import datetime import buildJSON
import state import indoorTH import pclogging
import time import os import signal import traceback sys.path.append('./SDP_Pi_HM3301/aqi') import aqi
import MySQLdb as mdb # ---------------------------------------------------------------------------------------------------------------------------------------------------------------
#cmd = [ '/usr/local/bin/rtl_433', '-q', '-F', 'json', '-R', '146', '-R', '147'] cmd = ['/usr/local/bin/rtl_433', '-q', '-F', 'json', '-R', '146', '-R', '147', '-R', '148', '-R', '150', '-R', '151', '-R', '152']
# --------------------------------------------------------------------------------------------------------------------------------------------------------------- # A few helper functions...
ThreadStop = False;
def nowStr(): return( datetime.datetime.now().strftime( '%Y-%m-%d %H:%M:%S'))
#stripped = lambda s: "".join(i for i in s if 31 < ord(i) < 127)
# We're using a queue to capture output as it occurs try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x ON_POSIX = 'posix' in sys.builtin_module_names
def enqueue_output(src, out, queue): try: for line in iter(out.readline, b''): queue.put(( src, line)) out.close() except: pass
def randomadd(value, spread):
return round(value+random.uniform(-spread, spread),2)
# MQTT Publish Line def mqtt_publish_single(message, topic): topic = '{0}/{1}'.format("skyweather2", topic) #print ("topic=", topic) try: state.mqtt_client.publish(topic, message) except:
|
|
|
Post by Jason on Jan 5, 2022 7:31:19 GMT -8
Why did I not see this before?!? In wirelessSensors.py, the path should be:
sys.path.append('./SDL_Pi_HM3301/aqi')
not:
sys.path.append('./SDP_Pi_HM3301/aqi')
Thanks,
Jason
|
|
|
Post by Jason on Jan 5, 2022 7:52:54 GMT -8
SDL looks like this defect was introduced to the script in release 27D. Thanks, Jason
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 5, 2022 7:59:21 GMT -8
@jason, I will make the correction and re-run. Results to follow. Thanks!
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 5, 2022 8:06:14 GMT -8
Change made but still a module not found error. I will check further but wanted to pass this along.
./SkyWeather2.JSON File exists Traceback (most recent call last): File "SkyWeather2.py", line 34, in <module> import wirelessSensors File "/home/pi/SDL_Pi_SkyWeather2/wirelessSensors.py", line 26, in <module> import aqi ModuleNotFoundError: No module named 'aqi'
|
|
|
Post by Jason on Jan 5, 2022 8:12:00 GMT -8
Interesting! Python is very particular about paths and I suspect that's the challenge. I'm gonna noodle some more on this and see if I can solve this for you.
Thanks,
Jason
|
|
nexusnet
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by nexusnet on Jan 5, 2022 8:18:20 GMT -8
@jason, If this script is run from the SkyWeather2 directory, shouldn't the path to SDL_Pi_HM3301/aqi start with ../ rather than ./? Or is the intent to import the ./ directory. I may be confused, but it looks like the same-named dir exists in 2 places.
|
|