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

"self" variable in OPC-N3_rec.py #4

Open
lildevilx opened this issue Apr 14, 2022 · 3 comments
Open

"self" variable in OPC-N3_rec.py #4

lildevilx opened this issue Apr 14, 2022 · 3 comments

Comments

@lildevilx
Copy link

Hello,

Inside the OPC-N3_rec.py, a lot of the def includes two variable (self, somethingelse). however when ever they are called in the main loop, it only has one variable. As well as there is something called "self.initOPC(ser)" What exactly does it do as this is not found in the OPC-N3_test.py.

Is it something that is required? I"m looking to just run just the OPC-N3 on my pi and finally getting the test version to work, it seemed quite promising.

Thanks!

@JarvisSan22
Copy link
Owner

JarvisSan22 commented Apr 14, 2022 via email

@lildevilx
Copy link
Author

Ahhh I didn't think the OPC-N3_rec.py relied on running start.py, I'd figured that it since the test worked normally, I could've ran the _rec.py the same way.

I haven't tried the start.py yet as there was a ton of syntax issue I ran into,
For example, for some reason my pi had a bunch of grief with the spacing/intents for the code.

I gave start.py and I'm running into more syntax and name errors like the following,

File "/home/pi/OPC-N3_python/AQ/OPCscripts/start.py", line 131 if MODE=="GPS": or MODE=="TEST" #if GPS or a TEST add the time in mins to the file name ^ SyntaxError: invalid syntax
Traceback (most recent call last): File "/home/pi/OPC-N3_python/AQ/OPCscripts/start.py", line 16, in <module> MODE=V.MODE AttributeError: module 'variables' has no attribute 'MODE'

I'll try to go through it and hopefully not break it anymore.

Thanks!

@lildevilx
Copy link
Author

Inside start.py I noticed this error
File "/home/pi/OPC-N3_python/AQ/OPCscripts/start.py", line 134, in <module> f=initFile(startime.strtime('%Y%m%d-%H%M%S'),RPI,FOLDER,LOCATION,R) NameError: name 'startime' is not defined
the variable should be starttime as per the rest the program.

Traceback (most recent call last): File "/home/pi/OPC-N3_python/AQ/OPCscripts/start.py", line 134, in <module> f=initFile(starttime.strtime('%Y%m%d-%H%M%S'),RPI,FOLDER,LOCATION,R) AttributeError: 'datetime.datetime' object has no attribute 'strtime'
I believe its suppose to be strftime

The last thing is I can't seem to figure out how to fix this, however if i commented it out I was able to get it to run
Traceback (most recent call last): File "/home/pi/OPC-N3_python/AQ/OPCscripts/start.py", line 152, in <module> newdata=pro.getData(p,r) File "/home/pi/OPC-N3_python/AQ/OPCscripts/opcn3_rec.py", line 383, in getData if data["period"]==0 or data["check"]==0: #error check added 04/09/2019 TypeError: string indices must be integers
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

2 participants