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

sensor_test.py fails #7

Open
jefflancaster opened this issue Feb 26, 2019 · 14 comments
Open

sensor_test.py fails #7

jefflancaster opened this issue Feb 26, 2019 · 14 comments

Comments

@jefflancaster
Copy link

uname -a
Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.8 (stretch)
Release: 9.8
Codename: stretch

python3 sensor_test.py
Traceback (most recent call last):
File "sensor_test.py", line 6, in
from cellulariot import cellulariot
File "/usr/local/lib/python3.5/dist-packages/sixfab_cellulariot-1.2.0-py3.5.egg/cellulariot/cellulariot.py", line 11, in
ImportError: No module named 'RPi'

This may indicate that I did not install cellulariot.py - I believe I obeyed the instructions as written.

Thoughts?

@saeedjohar
Copy link
Contributor

Install RPi.GPIO with the following command and then try to run the script again.
pip install RPi.GPIO

@jefflancaster
Copy link
Author

jefflancaster commented Feb 27, 2019

sudo pip3 install RPi.GPIO
sudo apt install python3-smbus
And it worked!
Thanks!

@kristoss
Copy link

it seems the bug is still unsolved.
If i try python sensor_test.py i get Import Error: No module named Adafruit_ADS1x15.
And if i try the python3 i get ImportError: no module named 'cellulariot'.
Any thoughts?

@d4rkd0s
Copy link
Contributor

d4rkd0s commented Mar 29, 2019

@kristoss you didn't install cellulariot correctly... try running sudo pip3 install sixfab-cellulariot first, and pasting the output of that here.

@d4rkd0s
Copy link
Contributor

d4rkd0s commented Mar 29, 2019

@kristoss I just did this all from zero to running, so I can probably assist with your problems.

@saeedjohar
Copy link
Contributor

saeedjohar commented Mar 29, 2019

it seems the bug is still unsolved.
If i try python sensor_test.py i get Import Error: No module named Adafruit_ADS1x15.
And if i try the python3 i get ImportError: no module named 'cellulariot'.
Any thoughts?

Did you use python3 for installation?
sudo python3 setup.py install

Doing python sensor_test.py will not work as the library is written in python3.

@kristoss
Copy link

Thanks for the response.I just tried the sudo pip3 install sixfab-cellulariot and the result is this
Collecting sixfab-cellulariot
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
self._validate_conn(conn)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in validate_conn
conn.connect()
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 323, in connect
ssl_context=context)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/ssl
.py", line 308, in ssl_wrap_socket
context.load_verify_locations(ca_certs, ca_cert_dir)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 392, in load_verify_locations
self._ctx.load_verify_locations(cafile, capath)
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 525, in load_verify_locations
_raise_current_error()
File "/usr/lib/python3/dist-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: []

@kristoss
Copy link

@saeedjohar on sudo python3 setup.py install i get ImportError: No module named 'setuptools

@d4rkd0s
Copy link
Contributor

d4rkd0s commented Mar 29, 2019

@kristoss Try to install setuptools again https://stackoverflow.com/questions/22531360/no-module-named-setuptools
Assuming you are on Raspbian:
sudo apt install -y python-setuptools

It might also be:
python3-setuptools instead of python-setuptools

I can get a full install history for my install, to show what command I've used to setup the shield working fully.

@kristoss
Copy link

@d4rkd0s thanks again for the response,it seems setuptools are up-to-dated.
python3-setuptools is already the newest version (33.1.1-1).
python3-setuptools set to manually installed.
i have updated and upgrade again all the features but still no love

Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.8 (stretch)
Release: 9.8
Codename: stretch

@d4rkd0s
Copy link
Contributor

d4rkd0s commented Mar 31, 2019

@kristoss if you have most of the libs installed you don't need setup.py
I ran without it, just install the libs that the samples require, 1 by 1 with pip3 install

@kristoss
Copy link

kristoss commented Apr 3, 2019

I reinstall raspbian on my sd and it worked.
It seems it was my mistake and not a bug.
Again thanks both of you for the support!

@battletroll01
Copy link

Kernel : Linux CellPi 5.10.14-v7l+ #1401 SMP Mon Feb 8 14:27:07 GMT 2021 armv7l GNU/Linux

After manual install, the cellulariot.py module fails when running python3 sensor_test.py

System errors with:
Sixfab Raspberry Pi Cellular IoT Application Shield Class initialized!
BG96 module disabled!
BG96 module enabled!
Traceback (most recent call last):
File "./sensor_test.py", line 18, in
print("Acceleration: "+str(node.readAccel()))
File "/usr/local/lib/python3.7/dist-packages/sixfab_cellulariot-1.2.0-py3.7.egg/cellulariot/cellulariot.py", line 724, in readAccel
File "/usr/local/lib/python3.7/dist-packages/sixfab_cellulariot-1.2.0-py3.7.egg/cellulariot/MMA8452Q.py", line 37, in init

After manually running the sensor_test.py I discovered certain function calls are missing, or I am in error and not doing something correctly:

from cellulariot import cellulariot
import time
node = cellulariot.CellularIoTApp()
node.setupGPIO()
time.sleep(0.5)
print("Acceleration: "+str(node.readAccel()))
`
dir(node)
node.AUTO_MODE node.USER_LED node.getTimeout(
node.BG96_ENABLE node.activateContext( node.ip_address
node.BG96_POWERKEY node.board node.port_number
node.CATM1_MODE node.clearGPIOs( node.powerUp(
node.CATNB1_MODE node.clear_compose( node.readUserButton(
node.CTRL_Z node.closeConnection( node.resetModule(
node.GSM_1800 node.compose node.response
node.GSM_1900 node.connectToOperator( node.saveConfigurations(
node.GSM_850 node.connectToServerTCP( node.sendATComm(
node.GSM_900 node.deactivateContext( node.sendATCommOnce(
node.GSM_ANY node.disable( node.sendDataComm(
node.GSM_MODE node.domain_name node.sendDataCommOnce(
node.GSM_NO_CHANGE node.enable( node.sendDataIFTTT(
node.LTE_B1 node.getBandConfiguration( node.sendDataSixfabConnect(
node.LTE_B12 node.getDomainName( node.sendDataTCP(
node.LTE_B13 node.getFirmwareInfo( node.sendDataThingspeak(
node.LTE_B18 node.getFixedLocation( node.sendDataUDP(
node.LTE_B19 node.getHardwareInfo( node.sendSMS(
node.LTE_B2 node.getICCID( node.setCATM1Band(
node.LTE_B20 node.getIMEI( node.setDomainName(
node.LTE_B26 node.getIMSI( node.setGSMBand(
node.LTE_B28 node.getIPAddress( node.setIPAddress(
node.LTE_B3 node.getLatitude( node.setMode(
node.LTE_B39 node.getLongitude( node.setNBIoTBand(
node.LTE_B4 node.getManufacturerInfo( node.setPort(
node.LTE_B5 node.getModemStatus( node.setScrambleConf(
node.LTE_B8 node.getNetworkRegStatus( node.setTimeout(
node.LTE_CATM1_ANY node.getOperator( node.setupGPIO(
node.LTE_CATNB1_ANY node.getPort( node.startUDPService(
node.LTE_NO_CHANGE node.getQueryNetworkInfo( node.timeout
node.SCRAMBLE_OFF node.getResponse( node.turnOffGNSS(
node.SCRAMBLE_ON node.getSignalQuality( node.turnOffUserLED(
node.STATUS node.getSpeedKph( node.turnOnGNSS(
node.USER_BUTTON node.getSpeedMph( node.turnOnUserLED(

Please advise, or correct me where I am wrong

@Parbelaez
Copy link

I am having the same problem as you, @battletroll01 . Did you manage to solve it?

Thanks!

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

6 participants