(I'm following this tutorial : https://www.pubnub.com/blog/raspberry-pi-gps-lte-google-maps-api/ and I use a Raspberry pi 4 model B connected trough wifi )
I carefully followed all steps carefully untill I tried to run the modified gps_simpletest.py file. When I try to run it I get the following error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 323, in _rec onfigure_port
orig_attr = termios.tcgetattr(self.fd)
termios.error: (5, 'Input/output error')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "gps_simpletest.py", line 21, in <module>
uart = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=10)
File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __ini t__
self.open()
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 272, in open
self._reconfigure_port(force_update=True)
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 326, in _rec onfigure_port
raise SerialException("Could not configure port: {}".format(msg))
serial.seria
I'm pretty sure I installed all modules, libraries, ....
Any help would be much appreciated!Thanks in advance
Related
I need to extract data from a digital multimeter using a USB connection and Python on my Raspberry Pi. Here I have a very basic Python script for reading from a generic USB device, and note that the idVendor and idProduct variables are correct for the multimeter I am using:
import usb.core
dev=usb.core.find(idVendor=0x067b,idProduct=0x2303)
ep=dev[0].interfaces()[0].endpoints()[0]
i=dev[0].interfaces()[0].bInterfaceNumber
dev.reset()
if dev.is_kernel_driver_active(i):
dev.detach_kernel_driver(i)
dev.set_configuration()
eaddr=ep.bEndpointAddress
r=dev.read(eaddr,1024)
print(len(r))
I have a rules file in the path /etc/udev/rules.d/99-usbftdi.rules. It has the following:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0x067b", MODE="0666"
When I try to execute the file while I have the multimeter turned on connected to my Raspberry Pi, I get the following error message:
Traceback (most recent call last):
File "usbRead.py", line 14, in <module>
r=dev.read(eaddr,1024)
File "/home/pi/.local/lib/python2.7/site-packages/usb/core.py", line 1024, in read
self.__get_timeout(timeout))
File "/home/pi/.local/lib/python2.7/site-packages/usb/backend/libusb1.py", line 869, in intr_read
timeout)
File "/home/pi/.local/lib/python2.7/site-packages/usb/backend/libusb1.py", line 954, in __read
_check(retval)
File "/home/pi/.local/lib/python2.7/site-packages/usb/backend/libusb1.py", line 602, in _check
raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out
------------------
(program exited with code: 1)
Press return to continue
I am trying to create connection to Hive hosted in HDInsight cluster through my python script and getting below error-
Traceback (most recent call last):
File "ClassLoader.java", line 357, in java.lang.ClassLoader.loadClass
File "Launcher.java", line 349, in sun.misc.Launcher$AppClassLoader.loadClass
File "ClassLoader.java", line 424, in java.lang.ClassLoader.loadClass
File "URLClassLoader.java", line 382, in java.net.URLClassLoader.findClass
java.lang.ClassNotFoundException: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransportException
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "org.jpype.JPypeContext.java", line 330, in org.jpype.JPypeContext.callMethod
File "Method.java", line 498, in java.lang.reflect.Method.invoke
File "DelegatingMethodAccessorImpl.java", line 43, in sun.reflect.DelegatingMethodAccessorImpl.invoke
File "NativeMethodAccessorImpl.java", line 62, in sun.reflect.NativeMethodAccessorImpl.invoke
File "NativeMethodAccessorImpl.java", line -2, in sun.reflect.NativeMethodAccessorImpl.invoke0
File "DriverManager.java", line 247, in java.sql.DriverManager.getConnection
File "DriverManager.java", line 664, in java.sql.DriverManager.getConnection
File "HiveDriver.java", line 105, in org.apache.hive.jdbc.HiveDriver.connect
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "s.py", line 5, in <module>
"/root/jdbc/hive-jdbc-1.2.1000.2.6.5.3009-43.jar")
File "/usr/local/lib64/python3.6/site-packages/jaydebeapi/__init__.py", line 412, in connect
jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
File "/usr/local/lib64/python3.6/site-packages/jaydebeapi/__init__.py", line 230, in _jdbc_connect_jpype
return jpype.java.sql.DriverManager.getConnection(url, *dargs)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportException
My Script is -
import jaydebeapi
conn = jaydebeapi.connect("org.apache.hive.jdbc.HiveDriver",
"jdbc:hive2://10.20.30.40:10001/default;transportMode=http;ssl=false;httpPath=/hive2",
["username", "password"],
"/root/jdbc/hive-jdbc-1.2.1000.2.6.5.3009-43.jar")
I have exported CLASSPATH wil all jar files.
The error is java.lang.ClassNotFoundException: java.lang.ClassNotFoundException which specifies that the execution is not able to find the jar /root/jdbc/hive-jdbc-1.2.1000.2.6.5.3009-43.jar.I believe it's only placed in a host from where you are executing the code. I would suggest placing the jar file in the same directory structure in all the nodes in the cluster and have a check on permissions so that the user executing the job has access to that path.
I am trying to set up the ChirpSDK, but every time I configure and run the code, I get this error:
Traceback (most recent call last):
File "test.py", line 3, in <module>
chirp = ChirpSDK()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 395, in __init__
self.read_chirprc(block)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 501, in read_chirprc
raise IOError('Could not find a ~/.chirprc file')
OSError: Could not find a ~/.chirprc file
Exception ignored in: <function ChirpSDK.__del__ at 0x10fa31af0>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 422, in __del__
self.close()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 470, in close
if self._sdk:
AttributeError: 'ChirpSDK' object has no attribute '_sdk'
I realize that the error is saying that my .chirprc file is not being recognized, but I have no idea how to remedy this. I created a .chirprc file in my /Users/username/ path, and named it c.chirprc (as the Chirp getting started article suggests), but I am still getting this error. Is there another part that I am missing? Am I reading the instructions wrong?
Thanks
The Chirp configuration file should be placed at /Users/<username>/.chirprc on macOS.
If you run ls -l ~/.chirprc in the terminal, do you get any results? If it displays no such file or directory then you have not created the file correctly.
I've still not been able to resolve this problem, after working on it for a week.
I'm thinking of giving up and just running theano on a virutal machine; there just doesn't seem to be any support out there for Windows 10!
Or am I wrong; is there an easy fix to this?
>>> import theano
Traceback (most recent call last):
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\lazylinker_c.py", line 75, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\lazylinker_c.py", line 92, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 1784, in _try_compile_tmp
os.remove(exe_path + ".exe")
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\cturn\\AppData\\Local\\Temp\\try_march_3v6ffkv9.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\__init__.py", line 66, in <module>
from theano.compile import (
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\compile\__init__.py", line 10, in <module>
from theano.compile.function_module import *
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\compile\function_module.py", line 21, in <module>
import theano.compile.mode
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\compile\mode.py", line 10, in <module>
import theano.gof.vm
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\vm.py", line 659, in <module>
from . import lazylinker_c
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\lazylinker_c.py", line 125, in <module>
args = cmodule.GCC_compiler.compile_args()
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 2088, in compile_args
default_compilation_result, default_execution_result = try_march_flag(GCC_compiler.march_flags)
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 1856, in try_march_flag
flags=cflags, try_run=True)
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 2188, in try_compile_tmp
comp_args)
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 1789, in _try_compile_tmp
err += "\n" + str(e)
TypeError: can't concat bytes to str
Um, can't concat bytes to str? What does this mean?
The error you are experiencing appears to result from another sub-process utilizing the same resources as the script you are attempting to write. Although it sounds trivial, I would recommend making sure that you have admin privileges, or at least privileges to the desired resources, and/or restart your computer to kill the sub-process using that module. You could also look in the task manager and kill any/all other processes using python, but that might take longer.
(This may be the program using the "resource" try_march_3v6ffkv9.exe)
I was trying to transfer a log file using tftp. For client side I am using TFTPY module in python. But it is showing below mentioned error messages.
WARNING:tftpy:Timeout waiting for traffic, retrying...
ERROR:tftpy:Timed-out waiting for traffic
WARNING:tftpy:resending last packet
WARNING:tftpy:Resending packet RRQ packet: filename = /opt/TDK/logs//55194186195512_Console.log mode = octet on sessions <tftpy.TftpStates.TftpStateSentRRQ object at 0xb70a0f8c>
Traceback (most recent call last):
File "callConsoleLogTransfer.py", line 30, in <module>
consoleLogTransfer(IP,Port,logTransferPort,fileName,localFilePath)
File "/file/consoleLogTransfer.py", line 68, in consoleLogTransfer
client.download( remoteFile, localFile, timeout=20 )
File "/usr/local/lib/python2.7/dist-packages/tftpy/TftpClient.py", line 52, in download
self.context.start()
File "/usr/local/lib/python2.7/dist-packages/tftpy/TftpContexts.py", line 378, in start
self.state.resendLast()
File "/usr/local/lib/python2.7/dist-packages/tftpy/TftpStates.py", line 203, in resendLast
(self.context.host, self.context.tidport))
TypeError: an integer is required