platisd / IoTink

Your portable & connected, e-paper dashboard
GNU General Public License v3.0
16 stars 4 forks source link

some questions to get this nice and great iotink #5

Open phototobi opened 5 years ago

phototobi commented 5 years ago

Hi, since i´ve seen your great iotink project, i like to fork it and build my own Display for our kids school bus timer. Quiet often they are that late missing their bus getting to school in time. I´ve already worked on grabbing the times from the webite of our local busservice with my beloved node-red running on my pi.

So i will to understand your code implent my mqtt broker and getting the topics for the two buslines and the times. For the weatherforcecast i would like to stay on your solution, as i already grab openweather data with node red using this api key. Maybe i´m wrong but it seems your are using the api key which comes out of a file? I´ve already made a free pythonanywhere account to get it running. Would it be possible to run the python script on my pi, simmilar to other python sripts which are running on it by edtitng the link of the credentials.h Otherwhise i ´ll try to understand how this pythonanaywhere works. It seems you are unsing not the beginners account. Does it make any difference with a beginner a.

Many thanks in advance. I hope i can make it, i´m still newbie with Arduino and this stuff but it´s wonderfull getting things running,sometimes with a little help from pro´s like you.

Tobias, from Königswinter, Germany

platisd commented 5 years ago

Maybe i´m wrong but it seems your are using the api key which comes out of a file? I´ve already made a free pythonanywhere account to get it running. Would it be possible to run the python script on my pi, simmilar to other python sripts which are running on it by edtitng the link of the credentials.h Otherwhise i ´ll try to understand how this pythonanaywhere works. It seems you are unsing not the beginners account. Does it make any difference with a beginner a.

Hi Tobias! Thanks for contacting me. I am not sure if I have understood what you mean entirely, but yes, the python script would be able to run anywhere, even in your own Raspberry Pi. I am reading the API key from a file because I don't want to version control it and accidentally commit it, but if you don't care about pushing your stuff on a public repository then you can simply place the key within your code. That is also the point with credentials.h. All the "secret" stuff I place in a header file ignored by git so I don't commit them.

On pythonanywhere.com I have a free account since both the weather website as well as the local public transport company are whitelisted and therefore can be accessed without the need for a premium account.

Not sure if I have answered your question, if not, please let me know!

phototobi commented 5 years ago

Hi thanks for your help. I´ve tried to understand foldername and filename for the api keyfile. Is there another "secret" header file? Can you send me a bulkfile how it should look like. Also for the api key(Is it just txt with key in plaintext? And where do you place the loaction for openweathermap to forcast it. Thanx in advance

phototobi commented 5 years ago

Another question? Is it a pythonanywhere web app. How does this work to place the forecast on this /info-center-data url

platisd commented 5 years ago

I updated your comment a bit because I realized I had mistakenly committed a file that I shouldn't have. :stuck_out_tongue:

In any case, I'd suggest you figuring out how hosting a python web server works on pythonanywhere and then working out the rest. Generally there isn't anything "special" done. It is a Python3 script that uses Flask.

The secret file merely contains the API keys in new lines. Nothing fancy at all. You can include them in your script instead, meaning that you don't necessarily have to have a "secret" file that has the keys.