Closed regis57 closed 7 years ago
Yeah, I need to add a how to install section in the readme, but here's a quick answer for you.
First copy the config.ini.sample and name it config.ini.
Take a look at the file and update the receiver latitude longitude and timezone. If your data and map urls are different, make sure to update them. Feel free to change the tweet_template so it will say whatever you want it to.
For the twitter section in the ini file you need to copy and paste 4 key strings from twitter. The Consumer Key, the Consumer Secret, the Access Token, and the Access Token Secret. Here's how you get them:
Make sure you never share those secret keys anywhere.
That's it. Assuming all the dependencies are installed (like the python twitter package, and selenium), you should be able to run it by going to the command line and typing "python3 tracker.py".
Good luck, and let me know if it works.
Hi Kevin, I manage to set up my adsbreceiver back online after few hiccups. Looking at selenium and python twitter package, do I need to install firefox as well? I have no GUI (no startx), will it still manage to screen capture picture for twitter? -Regis
@regis57 The Selenium package will create an in-memory representation of the website, and that is from where the screenshot is taken. No need to install Firefox.
Though get the pre-compiled one linked above, rather than trying to build it yourself, unless you have a lot of free time :)
Best of luck
pi@raspberrypi:~/AboveTustin $ sudo python3 tracker.py Traceback (most recent call last): File "tracker.py", line 9, in
from twitter import * ImportError: No module named 'twitter' pi@raspberrypi:~/AboveTustin $
thank you. Using pip I install Twitter and Selenium. Now I got the error above. I have setup the config.ini file with my details (GPS, time zone, the 4 lines of twitter app code). Do I still need the phantomJS package or Twitter and Selenium are enough?
For info: is that enough to install the twitter?
sudo pip install -U twitter Collecting twitter Downloading twitter-1.17.1-py2.py3-none-any.whl (55kB) 100% |████████████████████████████████| 61kB 839kB/s Installing collected packages: twitter Successfully installed twitter-1.17.1
Installed PhamtomJS using this method.
It added 2GB data. But I got same error as above.
I have no idea what I am suppose to do now with this:
sudo python3 tracker.py Traceback (most recent call last): File "tracker.py", line 9, in from twitter import * ImportError: No module named 'twitter'
@regis57
You don't (or shouldn't) need sudo
when running the script.
What does a simple pip list
show? Are you installing these libraries in a virtualenv? Or into the system default?
Also, while I can't get to my instance from here, it seems to me there is a shell script to run the whole thing, what happens if you try that, i.e. ./run_tracker.sh
.
@Jestre @kevinabrandon
*pi@raspberrypi:~ $ cd AboveTustin
pi@raspberrypi:~/AboveTustin $ python3 tracker.py
Traceback (most recent call last):
File "tracker.py", line 9, in
The command ./run_tracker.sh keep repeat my error line 9. I has to restart.
I run it all from the pi using ssh.
I tried to run python3 tracker.py with no sudo, got same error.
So do you also have a virtualenv (python virtual environment) created, or did you comment out line 8 in run_tracker.sh?
If you do have a virtualenv, what does pip list
show when it is activated?
@Jestre I am unable to tell its virtual or not. How can I know? I did not comment line 8 on this file you mention.
@regis57 Are you on IRC somewhere, e.g. Freenode? Might be easier than spamming everyone with messages here.
But basically, did you create a virtual python environment by using something along the lines of virtualenv py3
or mkvirtualenv py3
?
@Jestre unfortunately not. And I see no private message feature in here :(
@Jestre no I did not create a virtual env for python with these commands. Shall I proceed? Then how can I move stuff inside? It is automatic?
@regis57 I guess I am out of ideas as to why you are getting the python error. I was thinking perhaps you had a virtualenv, but did not have it activated when you installed the twitter library, but that now seems not to be the case.
From your command line, if you simply call python3 and import twitter, does it also fail?
$ python3
>>> import twitter (or)
>>> from twitter import *
^D to exit
@Jestre pi@raspberrypi:~ $ python3 Python 3.4.2 (default, Oct 19 2014, 13:31:11) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information.
import twitter (or) File "
", line 1 import twitter (or) ^ SyntaxError: invalid syntax from twitter import * Traceback (most recent call last): File " ", line 1, in ImportError: No module named 'twitter' exit Use exit() or Ctrl-D (i.e. EOF) to exit
@regis57 Okay, other than checking to see if pip3 list
yields different results than pip list
on that system, I have no idea what is going on.
In your paste above, the '(or)' was not meant to be typed, meaning try either that line minus the (or) or the the other. Either way, I see that it doesn't work. Let me know if pip and pip3 differ, otherwise I've no idea without some kind of access. Hopefully someone else will chime in :)
Sorry about the headache @regis57. It has been a while since I've done this, and it was only my second python project so I don't really understand python project configurations.
I do know that I setup a virtual environment, activated the virtual environment and then did a pip install twitter
. Once it's installed in your virtual environment you should be able to call import twitter
in the python interpreter without an error.
Sorry again for the headache, I wish I knew more about twitter projects (part of why I started this one) :)
thank you both @Jestre & @kevinabrandon for your help. So I went to install the virtual python, install in it the twitter and selenium. got same error. So I surrender. In a near future I dream about seeing this into an adsbreceiver.net like installer for noobs like me. In mean time, I have to forget about it, it's beyond my area of expertise for sure.
@regis57 If you want to try a TeamViewer session at some point in the future, let me know. It shouldn't be this hard :)
@Jestre with pleasure. But for now I have 'rage uninstall' the phantomJS with its 7hours of compilation. When I put it back let's do that. Does it needs to be install in virtual env as well?
@regis57 If this is all that is running on this Pi, it doesn't matter too much whether you put it in a venv or not. Did you install that with pip
as well? Some of these are better off installed via apt
or with the pre-built packages.
I'm having this issue:
Traceback (most recent call last):
File "/usr/lib/python3.4/configparser.py", line 1116, in _unify_values
sectiondict = self._sections[section]
KeyError: 'dump1090'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tracker.py", line 10, in <module>
import flightdata
File "/home/pi/AboveTustin/flightdata.py", line 34, in <module>
dump1090_data_url = parser.get('dump1090', 'data_url')
File "/usr/lib/python3.4/configparser.py", line 754, in get
d = self._unify_values(section, vars)
File "/usr/lib/python3.4/configparser.py", line 1119, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'dump1090'
@Jestre I have flightaware, planefinder, flightradar24, radarbox24 and duckdns running. Processor only top 45% (since recent addition of radarbox24) load on rpi3 and memory use is low.
hi guys FYI, I have turn to romeo-golf 2.6.0 fork of ADSBRECEIVER.NET and the install was a piece of cake. I just need to tweak my translation to french, fix mph to kph, distance in KM, waiting to correct altitude.
Hello, and thanks for this nice software - but unfortunately, I have a problem - I've installed AboveTustin in my RPi3 with Jessie, and installed python-twitter and python-selenium. I've corrected the default python to use in my system, aliasing python to /usr/bin/python3.4 executable. Now, when I run 'python tracker.py', I've not anymore this error >>>
File "tracker.py", line 9, in from twitter import *
But this one:
Traceback (most recent call last):
File "tracker.py", line 10, in
I've not used pip, I've installed the deps with common apt-get install. How can I import these modules to run right your code?
Thanks!
I got the phamtomJS installed already.
But sorry to be this noob, I have no glue on how to install the twitter. What are the command lines?
Same for aboveTustin, does a git clone is enough? with edition of the config file?
thank you for the details.