You are now following this channel
- You will see updates in your content feed.
- You may receive emails, depending on your notification preferences.
You are now following this topic
- You will see updates in your content feed.
- You may receive emails, depending on your notification preferences.
Sensehat problems in getting entries!
Hi!Yersterday i finally connected my rpi 3B+ with sensehat via Thingspeak.All worked just fine but today when i started the stream(run-prod.sh) number of entries appeared stuck on 0.I created a new channel but the problem still persist.If someone could help much obliged.P.S is a project for faculty.Any help would be helpfull.
Regards, Andrei.
Pin this topic?
This action will pin this post making it appear at the top of the recent discussion pages in the community.
Permanently delete this topic?
This cannot be undone.
Direct link to this reply:
Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Permanently delete this reply?
This cannot be undone.
So, what seem to be the problem then!?. To bad that i didnt exported the data when it still worked(streaming entries). Can we talk on social like skype, dicord, anything.I really need to get done my project this month. Please help!
Permanently delete this reply?
This cannot be undone.
I’m sorry, that’s not really a service we offer for free users. I haven’t used a sense hat. I would recommend trying to write without interfacing with the sensehat. There is an example in the ThingSpeak doc , but it’s a little out of date, I'm not sure it works in Python 3. (update coming soon). Anyone else on this forum have experience with the sense hat?
Permanently delete this reply?
This cannot be undone.
Are you able to update your channel in a web browser? Use the format https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=0 but fill in your write API key. If that works, but the pi still does not, then please share the part of the code on your pi that is updating ThingSpeak.
Permanently delete this reply?
This cannot be undone.
Yes!I am able to update entries through browser!In attachment i provided code of the project in src directory(.py files and 2 sh files).
Permanently delete this reply?
This cannot be undone.
Its good that you can update your channel, that means you must have the syntax correct for that part at least. We need you to share the parts of your code where you are connecting to ThingSpeak and sending the data, not the whole file. And what you are seeing in the code output when you run the file (please)
Permanently delete this reply?
This cannot be undone.
I see!Ok i will. import logging import logging.config import os.path
from flask import Flask from flask import render_template from apscheduler.schedulers.background import BackgroundScheduler from datastore import DataStore from sensehatwrapper import SenseHatWrapper
app = Flask(__name__) app.config.update( THINGSPEAK_WRITE_KEY="abcd1234", THINGSPEAK_CHANNEL='my_channel' ) app.config.from_envvar('WEATHERSTATION_SETTINGS', silent=True)
logger = logging.getLogger() datastore = DataStore(app.config['THINGSPEAK_CHANNEL'], app.config['THINGSPEAK_WRITE_KEY']) sensehat = SenseHatWrapper()
def setup(): # Set up logging logging.config.fileConfig(os.path.join(os.path.dirname(__file__), "logging.conf"))
setup()
def collect_data(): logger.debug('Running data collection') weatherdata = sensehat.get_weather_data() datastore.save_data(weatherdata)
def update_display(): logger.debug('Running display update') sensehat.write_data_to_display()
scheduler = BackgroundScheduler() scheduler.start() scheduler.add_job(collect_data, 'interval', minutes=1) scheduler.add_job(update_display, 'interval', minutes=1)
@app.route('/') def index(): logger.debug('Calling app root') weatherdata = sensehat.get_weather_data() return render_template('index.html', weatherdata=weatherdata)
Permanently delete this reply?
This cannot be undone.
I am not familiar with the sensehat library. Is it verified to work? Are you using their sample code?
Permanently delete this reply?
This cannot be undone.
Yes.But i was thinking maybe when i force shutdown the pi(unplugged) something happened.Or maybe i have a reatriction on entries number(how many entries could a student can have?)
Permanently delete this reply?
This cannot be undone.
Do you have a paid student license or are you using the free license? The total number of entries allowed is very large in either case, but the is a difference in how frequently you can update your channel.
Permanently delete this reply?
This cannot be undone.
A free license!So how often can i update my channel?
Permanently delete this reply?
This cannot be undone.
Free license holders can update a channel once every 15 seconds.
Permanently delete this reply?
This cannot be undone.
Ok.Can we speak/talk more details?How can i contact you?
Permanently delete this reply?
This cannot be undone.
Is ok?Am I missing something?
Permanently delete this reply?
This cannot be undone.
Ty for reply!I will try tomorrow and return with feedback.
Posts by this author
-
Discussion
Tags
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)