#help-with-wippersnapper-and-adafruitio
100 messages · Page 4 of 1
Not seeing anything for string...
bool save(char *value, double lat=0, double lon=0, double ele=0);
bool save(bool value, double lat=0, double lon=0, double ele=0);
bool save(String value, double lat=0, double lon=0, double ele=0);
bool save(int value, double lat=0, double lon=0, double ele=0);
bool save(unsigned int value, double lat=0, double lon=0, double ele=0);
bool save(long value, double lat=0, double lon=0, double ele=0);
bool save(unsigned long value, double lat=0, double lon=0, double ele=0);
bool save(float value, double lat=0, double lon=0, double ele=0, int precision=6);
bool save(double value, double lat=0, double lon=0, double ele=0, int precision=6);
There's char * on the first line and String on the third line.
What are you exactly trying to achieve?
My understanding is that you read a value from AIO that you can print as data->value but want to assign to a variable.
Which type of variable?
I am blind... I looked at that for 30 min and did not see it.
@steel panther I have a device that fires a webhook when it changes states and I am trying to set the neopixel to indicate current state.
What is the state? A string? A integer?
You've done the code up to be able to print( data->value()) so you've done 90% of it
If your device state's are 2 values such as 0 and 1, your code could be
If ( data->toInt() == 0)
// set your neopixel for state 0
Else
// set neopixel for state 1
Sorr on my phone from office, can type properly
Right now I have 10 cases, and they are defined by numbers
I was hoping to make them more readable
switch (mode) {
case 'off':
colorWipe(strip.Color( 0, 0, 0), 25); // Off
break;
case 'available':
colorWipe(strip.Color(0, 127, 0), 25); // Green
break;
case 'booked':
colorWipe(strip.Color( 127, 0, 0), 25); // Red
break;
case 'warn':
colorWipe(strip.Color(127, 127, 0), 25); // Yellow
break;
case 'timer':
colorWipe(strip.Color(127, 127, 0), 25); // Yellow
countDown(24);
colorWipe(strip.Color( 0, 127, 0), 25); // Green
break;
case 'locate':
rainbow(10);
break;
case 'hilton-blue':
colorWipe(strip.Color(0,0,255),25); // Hilton Blue
break;
case 'hilton-silver':
colorWipe(strip.Color(127,127,127),25); // Hilton Silver
break;
case 'hilton-gold':
theaterChase(strip.Color(255, 255, 0), 50); // Hilton Gold
break;
case 'hilton-diamond':
theaterChase(strip.Color(255, 255, 255), 50); // Hilton Diamond
break;
}
No matter, numbers are working fine!
This is fine. If your device is publishing string to AIO you can use
String mode = data->toString() ;
Just can't remember if you can use String in switch/case. Alternatively if (mode =='xxxx') should work
Use an If instead of a switch case for strings
Never used python or an Ada board before but I've currently got a tail of a log file on a server going up to adafruit.io and I'm going to pull that down and display it on a pyportal.
Can you pattern match on a feed trigger? I'm fiddling trying to see if I can get keyword from one feed to trigger a write to another feed
like if the word "error" shows up in a log line write a "1" to the counting feed
Maybe that is pointless
Tried the updated Adafruit IO Arduino library and was unable to connect. Also tried it with my ethernet shield's actual mac address in the .h file. Still no connect using the example ethernet sketch.
@outer skiff Did you try Adafruit MQTT?
@empty owl triggers don't do regex style matching
You'd be best off checking numbers on a feed, not strings
@robust panther, sorry to bother . Still with travis-ci: are pylint "C" (convention) reports considered as an blocking error?
C:155, 4: Attribute name "temperature_in_C" doesn't conform to '(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$' pattern (invalid-name)
C:161, 4: Attribute name "temperature_in_F" doesn't conform to '(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$' pattern (invalid-name)
-----------------------------------
Your code has been rated at 9.61/10
The command "pylint barbudor_tmp75.py" exited with 16.```
@steel panther yes, pylint must exit with 0, and code must be rated 10.00/10.00. There can be other errors (like too-long lines), and code might still rate as 10
It is so logical to have C and F capitalized as these are units
we do sometimes add pylint ignore markers when we disagree strenuously with it, but we often just acquiesce to avoid those
Tried the Adafruit MQTT updated library and got the same result: connected but no feed changes.
@outer skiff 🤷 The Arduino Ethernet Shield is not officially supported by it, featherwing definitely is.
The V2 may work better than the V1?
HI @royal rapids , I'm trying some sample codes from AIO Python on my Pi
The location sample crashed because there is no Client.send_location_data()function
missing code?
Change in the API ? Looks like we can do it with send_data()and metadata
location sample updated. Will put a PR
@steel panther Much appreciated. I thought I updated that while making the breaking change. Will look at later.
Hello, so I am using my raspberry pi with a bme280 sensor as a weather station which uploads to adafruitio. I am wondering if theres a way to view the live temps in an IOS app that has a good looking UI, instead of having to go to the website each time to check the weather. I basically just want an easier way to view the feeds from my phone than going to a website.
*other than DataFeeds, im looking for an app that would have easy to read live temps like a regular weather app
You would probably need to find an app which can subscribe to a MQTT feed from AIO and offer some display options. I don't know if this exist but that would be the keywords to use in a Google search
Searching MQTT in the app store returns some apps. I suggest you start from here. Cheers
Alternatively, if you had (say) a Bluetooth interface available, you could talk directly with an iOS app that way for local data monitoring, but I'm not sure you're looking for a non-AIO approach here.
@eternal cliff Adafruit IO works with BlueFruit as well 😃
There's a few MQTT applications for iOS out there, also: https://learn.adafruit.com/stream-iphone-ios-sensor-data-to-adafruit-io/overview
You may want to set this up, but in reverse with a MQTT client app of some type
IO NEWS: Plan Boosts! https://blog.adafruit.com/2019/04/18/io-news-adafruit-io-plus-plan-upgrades-are-here-adafruitio-iot/
That pushed to look into Android apps for the same (dashboards) and I'm trying 2 of them now : 'Iot MQTT Panel App' and 'MQTT Dash'.
Any advice would be appreciated. I'm trying to get a gauge on a temp sensor.
IoT OnOff by Kris Van Hoye https://itunes.apple.com/us/app/iot-onoff/id1267226555?mt=8
this should work great
basically made exactly for what i need it looks like
what would go here???
Host is io.adafruit.com
port would be either 1883/8883 dep. if you're using SSL or not
@royal rapids and where would i put my id thingy
@ davoos: it's pretty difficult to @ your username
That'd be within the authentication tab I believe?
I'm not 100% sure, as this isn't an official adafruit IO client.
You may want to look at the MQTT Documentation: https://learn.adafruit.com/welcome-to-adafruit-io/mqtt-api-documentation-2
path is probably 'your_username'/feeds/
@royal rapids nope, port number is good
oh it needs it w/ websockets
how do i do that
I don't have 🍎. Currently trying an similar android app and not obvious neither
I’ll stick w the adifruitio dashboard, is there an app in ios that makes the site seamless? I am able to add a shortcut to the home screen to safari, but I’d rather just be able to click an app or something and it would show the dashboard and nothing else
hmm, I might try and hack together a script to take the data from your mqtt feed and post it to weatherundergound or something similar that has a nice app
Hi, I've got a problem with the Adafruit IO service. Is there anyone able to help here?
@sacred depot go ahead and post your question or describe your issue. People will help if or when they can.
I'm trying how ti figure what cause MQTT server to be unresponsive. I guess it could be an issue related to rate limit, but I don't know how to check for it.
Hi @sacred depot , are you publishing or subscribing?
@sacred depot You can check if you hit the rate limit on the monitor page here: https://io.adafruit.com/monitor
Make sure you're logged in first
YES, I See. I've raised the limit up to 150 per minutes, that seems a lot, but still hit the rate limit. I can't see what's causing this traffic
Since I have more that one source for the data, all going to the same FEED, my guess is that "sometimes" all the data arrive pretty close. But it isn't a "flood", it shouldn't saturate the bandwith so easily. And if this situation occur, apparently the feed stays blocked for a long amount of time up to two minutes.
I constantly reach the webhook datarate limit.
@sacred depot Could you post on the Adafruit IO Forum and I'll have someone from the IO Web Team look at it? https://forums.adafruit.com/viewforum.php?f=56
That should not be happening, especially with increasing the limit via a boost. There may be some rate-throttling for the webhook that is independent of a feed, or something like that. I'm not sure.
@abstract mica You could absolutely set up a relay between Adafruit IO and any other application. We've done it before with HomeAssistant.
- Are there any plans to fix the filtering issue when looking at a feed?
- Is possible to delete data without deleting a dashboard all together?
- Is ADA IO dead?
Best Regards
@faint hare 1) Which filtering issue?
- You can delete individual data points on a feed. Dashboards display feed data.
- Absolutely not.
@royal rapids I have one for you: why a dashboard block limit of 5 feeds?
@woeful tinsel It's to keep the user experience manageable.
@royal rapids IMakes sense, and too much data on a chart gets messy. But it just had to be 5 and not 6. (I have 6 related feeds that would be nice of a single chart 😃 )
WooHoo! just got a Particle Mesh (xenon via argon) to publish temperature data to AIO via WebHook . Pretty nice!
😮
Nice!
@keen dirge I'm writing a webhook tutorial later this week, did you just use the IO default webhooks?
yes --- just had to modify the default "integration" at the particle site to add "value" and "created_at" lines to the default Form.
Sweet!
Hello, I am trying to subscribe to an AIO feed through an Android MQTT client and I have some difficulties to get it understanding the data. It looks like it is expecting the data in JSON but when I use tcpdump with Adafruit's subscribe sample, it looks like I'm receiving raw ASCII.
Is that correct ? And if yes, is there a way to get JSON from AIO MQTT subscription ?
Thanks
=> Found it. You need to append /json to the feed_id
@royal rapids how can I delete e.g. 3000 datapoints out of 19000 without having to click 3000 times? I created an issue on github with regards to filtering. There is an animated gif in the issue post, search for adafruit io issues, it is a repo by itself. How many developers does Adafruit have full time on this, if any?
@faint hare You can use the delete existing data endpoint, most Adafruit IO libraries have this endpoint available as a function
By the way, I haven't been able to use the 'filter' option in AIO web. I can select 2 dates but can't find how to apply it. Anyone succeed?
Just a screenshot of Android app 'IoT MQTT Panel' subscribing to AIO feeds
Looks nice and effective. Will try soon with action buttons
@royal rapids ok trying out the endpoint, but it is still 1 point because of the required id in the rest call. So I would still have to write a script to iterate through the data..
@faint hare it's also worth noting that every data modification API call (create, update, or delete) is under the account rate limit, so your deletion script will either have to delay or delete in batches
@faint hare we've also deployed an update to the feed filtering functionality to make sure:
- page counts are accurate
- new data that's outside the filter range isn't added
- it's clearer when filters are active
- it's easier to reset / clear the filter range
@faint hare we've also put the io-issues repository into read-only mode. We don't link to it from any current documentation and used to use it to receive bug reports, but we've added a feedback form to IO itself and started the Discord server since we created that repository. Sorry about the confusion.
I appreciate the answers @novel ember thank you so much :)
I'm having some problems with the Adafruit IO Arduino library. Before I get into that, does it support "generic" ESP32/ESP8266, or only the HUZZAH and Feather boards?
I'm trying to build the Adafruit IO examples for my ESP32 dev board, but it keeps giving me compile errors
trying to get adafruit io up and running on rpi with python, decided to follow this tutorial
it doesn't seem to mention explicitly that you need to pip install adafruit_io library
and neither does the blinka install howto
but pip install adafruit_io also fails
´ Complete output from command /home/pi/aio/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-6qzw0_ow/adafruit-io/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpmy787en3pip-wheel- --python-tag cp35:
version: 2.3.2
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
´
this is in a venv
Hi @strong wigeon , this is the guide I followed : https://learn.adafruit.com/adafruit-io-basics-digital-input/python-setup
Indeed you need to install adafruit-blinka and others
On my RPi I used pip3, not pip
and sudo
I'm running in a venv where python is python3 so pip is pip3
pip install wheel seems to have resolved this
ok, not yet familiar with venv.
This being said, my AIO setup works fine. Played with triple temp sensors (AM2302, 18B20 and TMP75) to compare them.
yay, sensehat data flowing to aio
@steel panther https://learn.adafruit.com/adafruit-io-air-quality-monitor
i followed that, but modified it to only utilize the bme280
https://pastebin.com/kz7ftaca is the modded scrip
@novel ember filtering still does not work and is now a bit wonky, do I create a new issue on the read-only repo or just post a gif here?
@faint hare the best place to post would be on the IO forum: https://forums.adafruit.com/viewforum.php?f=56
reports on Discord can get lost in conversation history
Hi Guys. Do any one has idea that i can use adafruit IO for commercial product ?
@hot juniper You can absolutely use Adafruit IO for developing a commercial product.
However, we recommend developing a product with Adafruit IO and later from Adafruit IO to a more robust IOT platform like particle's cloud when you're ready to start selling/deploying lots of IoT products
@royal rapids Thanks for reply. Its very interesting though i developed prototype of my product through adafruit IO for commercial product i have some question regarding IO cloud. I don't know who to contact. Can you help me with that ?
@hot juniper You can contact adafruitio@adafruit.com with any questions you may have
@royal rapids Thanks
no problem!
Returning with a problem getting Adafruit -io to change the data in my io. Using an Arduino UNO-R3 and an Ethernet2 shield I am able to connect consistently, but the feed that I am trying to change will not update. My code is very simple, and seems to follow the library's protocol. Can anyone help?
Does anyone know the command structure to publish data to Adafruit-io feeds?
Hi @outer skiff , are you trying to build the commands by yourself or using Adafruit Io library for Arduino. With the lib it should be quite straight forward like the 1st sample which publish a counter.
but in the sample there is 1 file you need to change to specify how you connects to the network. The default is to use wifi through esp32.
I'm trying to use the Adafruit library. I have tried all the commands from the examples in the library. There is no problem connecting to AdafruitIO. I connect every time as illustrated by the AdafruitIO monitor. My problem is being able to publish to my feeds. None of the "publish" commands have any effect on my feeds. I am going to delete the libraries and re-install them to see if one of them might be corrupted.
Found my problem. Senior moment...................
@outer skiff Out of curiosity, what was the issue?
Little bit of a LEEK before this month's newsletter: https://github.com/adafruit/awesome-adafruitio
@royal rapids is there a AIO email letter we can subscribe like the Python on HW one.?
@steel panther Soon, very soon 😃
Currently the newsletter is posted on the Adafruit Blog and the Adafruit IO Development blog
first friday of the month, so this friday will have one
Thanks. I'm reading the blog but not always in time 😁
Keep your eyes out this week, I'll post in here when it's ready to take email subscriptions
Cool. I will add a reminder for 1st Friday in my calendar
A missed closing curly brace that the compiler didn't catch and the variable that was sent needed to be floating point rather than integer. My bad........
Are there any planned updates for this? https://github.com/adafruit/adafruit-io-node
A Node.js Adafruit IO Node.js Client, Local Server, & io.adafruit.com TLS Tunnel. - adafruit/adafruit-io-node
It's saddening to know that last time it was updated was 3~4 years ago
hi @nimble wadi, we try to put our focus and developer attention in places that are seeing community activity or causing us trouble, you may be the first person who's asked about that library in 3 years :D
it's also open source / MIT licensed, pull requests are welcome
was there something in particular you're trying to accomplish?
Got a PyPortal/Metro M4/AirLift ESP32 Breakout? Now you can connect them to Adafruit IO using either CircuitPython OR Arduino!
Nice !
Hello from Port Elizabeth South Africa, I have a quick question, hope someone can point me in the right direction
Can I use adafruit.io just as a broker between my device and my ui based on NASA OpenMCT
Is there a tutorial of writeup somewhere perhapse
Hi @hidden wigeon , you should be able to use AIO as a generic broker given that you fullfill the AIO topic scheme: username/feed/feedname and stick with the throttle limits.
It may be possible (not tested) that you can use other topic schemes but in that case data will not be ingested in the core of AIO
@steel panther Thank you for the feedback I will experiment a bit and see what works for me, many thx
Thank you!
This is largely a 1:1 conversion of the old system (https://github.com/adafruit/io-api) which relied on huge machine readable .json files in a very particular format into a human readable Markdown based static site generator (https://github.com/adafruit/Adafruit_IO_Documentation/).
The two big things we couldn't include in the old system that we've already made space for are the MQTT API and a cookbook-style page of patterns/recipes for more advanced usage. It's all in progress, but it's much easier to make progress with this system than with Swagger + ReDoc.
Thanks Servet!
Hi, I'm trying to use the webhooks right now but got a "record invalid" message. What format should be provided ? Should it be JSON with value/lon/lat and all the stuff ?
The samples curl calls in the doc doesn't show the data (and probably erronously specify to use -H "X-IO-Key")
Hi @adam.ion
So I've been able to get the webhook to work with both :
curl -data "value=42" http://io.adafruit.com/api/v2/webhooks/feed/:token"
and
curl --data "{ \"value\":42 }" -H "Content-Type: application/json" http://io.adafruit.com/api/v2/webhooks/feed/:token"
-F "value=42" as given in the doc doesn't seems to work
and -H X-AIO-Key: {io_key} is definitively not needed
Hi there im talking in the oub and a mate has asked is the data sent to and from adafruit io encrypted thirt id ask as i dont no if the top of my head ?
If you are asking is the data in and out are encrypted, yes as far as you are using https API and not http
Cool i hope so im using the arduino example?
May depends on your board and network interface
Hmm arduino wemos just the straight example
You mean a board based on ESP8266 or ESP32 ?
Is it working ? I though AdafruitIO lib was working only on MKR or using the ESP32 module
What did you enabled in config.h ?
Esp8266 wemos d2 mini working fine . I just added the wifi details in and the io key
I found it, it uses https on all boards
Cool thanks
Has anyone tried to publish a JSON with multiple values like explained in : https://learn.adafruit.com/welcome-to-adafruit-io/mqtt-api-documentation
In section "IO Formatted JSON", the below example is given :
"value": {"sensor-1":22.587,"sensor-2":13.182},
"lat": 38.1123,
"lon": -91.2325,
"ele": 112
}```
So I tried to publish as :```{ "value": {"temp":20.2, "hum":53.8, "vbat":3.984} }```
But what is recorded is: ```{"temp"=>20.2, "hum"=>53.8, "vbat"=>3.984}```
This is also what I received as a MQTT subscriber.
So I can't parse it as JSON.
Any idea what I would have done wrong ?
that looks like PHP's notation
Could it be a bug in AdafruitIO ?
where are you seeing the => formatted output?
how are you sending the data? Which platform/library?
hi , sorry it was time for 🛏
I'm using webhooks on a ESP8266 (µPy, urequests) and on Windows using curl. Both shows the same. I'm going to test with MQTT in Adafruit_IO on RPi later today.
I've finally been able to publish a proper JSON value ({ "value": { _some_json_ } }) to AdafruitIO using either:
- Webhooks/RAW
- Adafruit MQTT client on RPi
Can't publish a JSON value using Adafruit IO client on RPi
Would it be possible to increase the limit on image streams from the current 100kb for pro users? I know this is a bigger request but it would mean a lot if there was a way to do this. Maybe 200kb-500kb range?
HELP Metro 328 on/off switch broke. How can I power without plugging it in the computer?
@desert ferry You can still power it with a 5V USB supply. If you have the pieces ofthe switch, you may be able to reassemble it and snap it back on.
Question for when you get into answering them.. any guidance on when e-ink feather wings will be back in stock ? Soothe b&w or tie-color option. Thanks 🙃🙃
Ignore wrong Chat room
hi, how do I delete my adafruit IO account?
?
My Account -> Security & Privacy -> Delete account
Note that this will delete your complete Adafruit account
IO is not separated
Thank you 😃
Hello I'm looking for the code to post data froma adafruit INA219 to ada io - anyone have anything that would help out there ?
i'm using a uno
with esp8266
Hi @fresh anchor , do you have each parts working on it's own?
- reading Ina219 and printing on screen
- sending to AIO a random value or a cou ter
If yes, merging both shouldn't be complex. There are a lot of sample available showing how to publish temperature to AIO. That should lead the way to it.
Hello barbudor I have the ina219 outputting to the seri. monitor without issue, I can run the adafruit mqqt test and I see the data on the ada io console. \o/ but yes I need help merging the 2 configs.
I have sent hours hacking p this old config I found on github but no luck.
I got this far
here's the seri. monitor log
Hi @fresh anchor , I'll look tonight (I'm utc+2)
UPDATE: EspressIF reverted their breaking changes from the ESP8266 board support package 2.5.0 in the latest release of BSP2.5.1. I've patched the Adafruit IO Arduino library to support this in the latest release.
If you've downgraded to the ESP8266 board support package 2.4.8, you can now upgrade to 2.5.1 and use the latest version of Adafruit IO Arduino: https://github.com/adafruit/Adafruit_IO_Arduino/releases/tag/3.2.0
@royal rapids , Could this "breaking change" apply to @fresh anchor issue above ?
He gets an "Exception(3)" during mqtt.connect()
@steel panther no, he's using Adafruit MQTT not Adafruit IO Arduino. The change above is for AIOA.
I did update Adafruit MQTT yesterday, though, to reflect the new ESP8266 Board Support Package (2.5.1), so be sure to update that library to v1.0.3 and your ESP8266's board support package to v2.5.1 to rule out any possibilities.
Hello. I am having problems using MULTIPLE switches in Adafruit IO and being able to read ALL activities regarding these switches using ESP8266 huzzah feather. The handleMessage procedure from the examples seem to work fine for 1 switch. Trying to do this for 4 switches fails. Any comments?
@sacred depot handleMessage ties to a feed
You'll want to put each switch on its unique feed
yes, I did that.
Could you paste your code on https://gist.github.com or the adafruit support forum for IO https://forums.adafruit.com/viewforum.php?f=56
thanks, it'll help me debug with you faster 😃
ok, posted the code at the forum: topic = multiple switches problem with Adafruit IO and ESP8266
@sacred depot Thanks for posting, I'll check it out.
or maybe someone will beat me to it 😆
Tx !
@fresh anchor , I reproduced the same issue as yours
IP address:
192.168.168.63
Connecting to Adafruit IO... Fatal exception 3(LoadStoreErrorCause):
epc1=0x4020863c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x4023b891, depc=0x00000000```
with your code...
@steel panther Ah, yeah. That's due to board support package 2.5.1... @fresh anchor Try updating your version of the Adafruit IO Arduino library to version 3.2
@steel panther Which BSP were you running to repro that?
latest 2.5.2
Do you have the latest version of Adafruit IO Arduino installed?
adafruit mqtt 1.0.3
1.0.3 shouldnt be dumping the stack...
adafruit IO 3.1.0
Try updating Adafruit IO Arduino to 3.2.0
k let me know if the same behavior occurs on your end - it shouldn't...
No, I just fixed an example within MQTT for the ESP8266 in 1.0.3
Whatevern, the default samples "mqtt_esp8266" works fine
Does secure MQTT ESP8266 work?
didn't tried as morwic wasn't using secure
I'm trying again morwic's code with AIO updated to 3.2.0
(which shoudn't change anything)
the latest patch in ESP8266's BSP 2.5.1 only impacted WiFiClientSecure, not WiFiClient which is what Morwic uses in their sketch
same crash.
I am now trying to backport the INA219 stuff in the mqtt_8266 sample code
@steel panther Ok, what board are you using?
I'm using an Amica NodeMCU
little compile problem.
I have :
float power_mW = ina219.getPower_mW();
if (! power.publish((double)power)) {```
error: invalid cast from type 'Adafruit_MQTT_Publish' to type 'double'
I was expecting to use :
`bool publish(double f, uint8_t precision=2);`
I just took the default mqtt_esp8266 sample code, dropped all code regarding the subscription. Was ok with the demo counter
Inserted INA219 which provide a float
Et boum...
ok, missing )
@fresh anchor , here is a working code
I restarted from the provided mqtt_eqsp8266.ino code, stripped all subscription, keeping only the publish code.
Then I added the INA219 code.
All good.
No delay() as delay is devil 👹
Didn't had time to compare in more details with your code which looked good at 1st
There must be a very subttle difference ...
Good excercise as I'm planning to do a bit of ESP+IOT in Arduino to change a bit and comapre with micropython
@royal rapids I understand delay is not a good thing to have. But is there a different way to 'get' the latest value from a switch in Adafruit IO using ESP8266 huzzah?
@royal rapids I reduced the code to its basic structure for reading switches. I implemented 4 switches in Adafruit IO and can read all switches without problem, even with 1,5 sec delay after each loop.
@sacred depot are you talking about the fact that when subscribing to a feed using MQTT, you don't receive the last valid value until a new value is published?
@royal rapids yes, I get this when implementing both reading and sending values.
If I'm correct using AIO API instead of MQTT you can always poll the latest. Alternatively the MQTT section in the AIO learning guide explain how to force AIO to send an ad-hoc refresh.
If I remember you have to publish to /feeds/value/get
So if you do this on your 4 switches right after subscription, you can then work using only subscription update message
Not sure I'm answering the right question
to be more correct, I use the AIO implementation at the moment. I started with a test where I only read 4 switches in a loop using esp8266. I delay with 1,5 sec in each loop. The response is working for all switches, no problem there. Now in a second test program I add writing values to adafruit IO. Now it seems the 'read' function is being disturbed, resulting in that it sometimes manages to read, but most of the time not.
problem in code?
@steel panther Is your advice to use MQTT implementation and not the AIO functions?
Not specifically. I thought you were using MQTT and facing this specific MQTT issue were the server do not send the last valid value when subscribing
I'll try to look at your code see if I see anything but I'm still at work now
May be you are not calling io.run() enough
You may rework your loop to avoid delay()
@steel panther update: created 5 switches, sending as well data for registration to AIO. The first 3 switches work fine, the last 2 don't work at all. (removed the delay in my code)
first 3 switches work fine, the extra 2 switches don't respond
I have a less elegant solution around the problem, instead of switches I use a single slider to encode all possible positions I like to have for my switches. This works fine, but the original problem with mutiple switches reading persists.
... somthing to put on the wishing list of 'nice to have'
@sacred depot , basic question, are you paying subscriber to IO+ ?
Don't forget that free account is limited to 10 feed. Your code is using 19 feeds. I can't test it.
@fresh anchor , @royal rapids , I found what is the breaking difference between my code (based on the sample) and Morwic's.
Morwic's code has all constants for MQTT placed in Flash :
// This is required for using the Adafruit MQTT library.
const char MQTT_SERVER[] PROGMEM = AIO_SERVER;
// Set a unique MQTT client ID using the AIO key + the date and time the sketch
// was compiled (so this should be unique across multiple devices for a user,
// alternatively you can manually set this to a GUID or other random value).
const char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;
const char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;
const char MQTT_PASSWORD[] PROGMEM = AIO_KEY;
// Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.
Adafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD); ```
In the sample code I used, those parameters are standard #define:
```#define AIO_SERVER "io.adafruit.com"
#define AIO_SERVERPORT 1883 // use 8883 for SSL
#define AIO_USERNAME "...your AIO username (see https://accounts.adafruit.com)..."
#define AIO_KEY "...your AIO key..."
// Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);```
Moving to #define (constant loaded into RAM) instead of PROGMEM remove the crash.
Any idea bentr ?
@steel panther not sure, I've never seen credentials defined in PROGMEM before, but @fresh anchor should definitely switch to using #defines for their credentials - that's how we do it across our arduino libraries
I was wondering if this was coming from an older sample code ?
@steel panther possibly - the recent releases have #defines in their examples, though.
indeed, that what I used as I jumped into AIO+Arduino only 24H ago ;)
Thanks
np - AIOA is due for a doxygen soon 😃
@steel panther yep, I am a IO+ subscriber. 👌
@steel panther everything works now with a slider, but the problems persist with multiple (3 or 4) switches in a simple code.
Your code looks good but I can't test it as I don't have IO+. I can try bt only with the switches, not with the values
By the way, a little issue in your code is your time comparison
if (millis() > (lastUpdate + IO_LOOP_DELAY)) {
Using addition doesn't work when time is reaching the wrapping point
You should use subtraction :
if ( (millis() - lastUpdate) > IO_LOOP_DELAY ) {
It looks the same from mathematical point of view but it isn't in a world of size limited integers.
Also setting up lastUpdate = millis() at the end of the loop means that your effective period is equal to IO_LOOP_DELAY + time_to_process
You could make it better by moving the expression right after the if, or even better :
lastUpdate += IO_LOOP_DELAY
This will compensate for all variable processing time and insure a much more accurate period
@sacred depot , I have no problems running the 5 switches. I have to reduce the published values to only temp and humidity, and also limited in defaultand groups 1 and 2 becuase of my IO account limitations. I don't know if it works because I reduced the number of feeds or for some other reasons
I'm running on an ESP8266. What's your board configuration ?
ESP8266 huzzah feather
ok. here is what I ran to get the screen shot above:
I added esp8266wifi.h on top of the sketch as I've seen on others. Didn't try without
Only difference is reduced number of feeds
But all 5 switches are there
ok, tx for your help. I will try again.
The first Adafruit Internet of Things Newsletter went out this morning. If you're not subscribed, head over to https://www.adafruitdaily.com
Done !
Hello @steel panther any luck yet sir ?
I already responded, providing working code 2 days ago, and yesterday I pointed out what was making your codde crash.
ahh yes yes I see now sir 😃
😉
I get a error now in #include "secrets.h" line 35 and line 51 ?
your the best @steel panther
looks like a missing file
hum
Yes, it's my own secrets. It defines my SSID and my AIO KEY
This is to avoid sharing my mistake secrets when sharing code
remove the line and set back you own ids
I see can I just // it
roger stand by 😃
hum now I get error on line 51 " Adafruit_MQTT_Publish power = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/power"); " output- 'AIO_USERNAME' was not declared in this scope ?
it's defined in the adafruit io setup thos ?
line 45 - Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY); .
or is it looking for something else ... humm
"and set back you own ids" as in AIO_USERNAME and friends.
is wherever your #define AIO_USERNAME foo given included?
Original code had #define for SSID, WLAN password, AIO USERNAME and AOI KEY
I commented out those and put mines in secrets.h
Not my invention, stoled the idea from Adafruit secrets.py on PyPortal 😄
I see thank you @steel panther next eror line 75 Serial.println(WLAN_SSID);- output 'WLAN_SSID' was not declared in this scope ?
nicen ice I need to get in to py. I have a ton of adaboards for CP
same root cause for that error.
hum
I see 😃
got it
rock on
❤ ada
ahh no error meow \o/
uploading
holy wow
it's working
omg omgogmogmo mgom gom ogm omgo mgomg ogmomg
The most important thing is what I posted yesterday : the reason why the code was crashing.
Usage of string in PROGMEM seems not to be supported by Adafruit MQTT library.
I don't know if you had the idea by yourself or if you found some sample code on the Internet that was using PROGMEM, but apprently it does not work. All sample codes provided by Adafruit with their library are using #define and not PROGMEM
yes I found it on githum I have been trying for 120 days to get this working so I could see the battery volts on my solar systems
I've just been trying to hack it up to get it to work. but thank you folks so much !
I wish discord had a tip opps/
@fresh anchor could you link me to where you found that code?
it's either wrong or needs to be deprecated if it's an official adafruit piece of code
hum it's pub'in the Power and not the shunt I take it I need to make a feed for every value
@royal rapids , google drove there:
https://github.com/adafruit/adafruit-io-basics/blob/master/esp8266/group_sensor/group_sensor.ino
Here it was working anymore https://github.com/openhomeautomation/adafruit-io-esp8266/issues/3
So it looks a few years ago it was working but something changed between 2015 and 2016
Not a bad idea in itself. Could be interesting to look how to re-introduce it
Yeah, the basics group of guides are now part of the AIO_Arduino library
yes sir @steel panther I found the code on github it was 2 years old with a few people asking about why it did not work but the dev never replied ?
would the ina219 work with a fona feather you think ?
Trying to compile for esp8266, downgraded to 2.4.2, error 'class axTLS::WiFiClientSecure' has no member named 'setFingerprint' anyone know what this is ?
oh it looks like I may have to downgrade wificlientsecure as it has probably been updated to use bearssl for 2.5.0 compat
that did not seem to work..
BearSSL supports fingerprint
Yeah I just cant figure out how to switch it, it should be the default, but its clearly not
Peering at the source code, I see where it's referenced, but it's not clear to me how to set it up.
what makes no sense is the library says it doesn't work with 2.5.0, so why is it using bearssl methods that do not exists in arduinohttpclient..
I got it working, that issue was already outdated, so I installed staging and removed arduinohttpclient
hah spoke to soon , thought it was gonna work
I thought pio was caching an lib_dep, but it still is borked
Dependency Graph
|-- <Adafruit IO Arduino> 3.2.0
| |-- <Adafruit MQTT Library> 1.0.3
| |-- <ArduinoHttpClient>
| |-- <ESP8266WiFi> 1.0
| |-- <SPI> 1.0
hum upgraded ada io today, but I'm still limited to 30 useage a minute ?
said to upgrade and get 60 usage a minute ?
I was so close
@fresh anchor Thank you for upgrading to IO Plus! Could you contact adafruitio@adafruit.com? We'll check this out.
@dusty hawk What ESP8266 board support package are you using?
I want to measure data in space. Do you think Adafruit IO would be good for this?
I mean I am currently ordering parts for a ground station. So I don't know
@Sys32Modus To obtain measures from satellites use the https://satnogs.org/ project
Ok thank you!
@cosmic girder Do you mean you want to measure data from objects already in space, or you want to build an object to go into space to measure data with?
if the latter, adafruit.io might be a good fit for the ground part of your workflow, where you have reliable Internet connectivity, but probably not directly called from the object in orbit.
If you're not already a member of AMSAT, I recommend going to their website and looking over their material. Even if you're not an amateur radio operator, AMSAT provides a lot of good technical detail on the issues and challenges of building, launching, and operating a CubeSat.
Some of the articles in recent (within the past year) episodes of the AMSAT Journal talk specifically about various telemetry options, how to ensure that your telemetry actually gets read by a ground station before it passes out of the buffer of your satellite.
Lots of issues (power management, if you're in a LEO -- there will be orbits that your footprint doesn't allow a ground station to receive, or orbits where your sat is in shadow and is working on battery power only, etc.)
Plus the books I mentioned in the other thread, to help identify other engineering challenges
but this is the Adafruit.IO help channel, so we should probably switch the conversation back to a more appropriate channel
Alrighty! Will do. Thanks!
Hello i have a question i was trying to use Last Will Feed in my code but the problem it did not work and after i add the code line mqtt.will(WILL_FEED, "OFF"); in the End of Setup Function the arduino keep trying to connect to my AdaFruit Server and does not success but after comment the code line from the code , arduino connect directly
@sacred depot What sketch are you running?
Could you provide some more information such as the sketch you're using and the Serial Monitor output?
Here is the code https://textuploader.com/1dqo8
/***************************************************
Adafruit MQTT Library ESP8266 Example
Must use ESP8266 Ar...
Hi @sacred depot , in the below code :
const char WILL_FEED[] PROGMEM = AIO_USERNAME "/feeds/onoff";
Remove PROGMEM
It seems that old sample codes (before 2016) are still available on the Web but are not supported anymore.
In any doubt, always refer to the sample codes that are provided with the latest libraries.
Just move to
Adafruit_MQTT_Publish lastwill = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/onoff", MQTT_QOS_1);```
Like the rest of the code above
Thank you Mr.BarDudor now it works Fine after i have chenged the code to this const char WILL_FEED[] = AIO_USERNAME "/feeds/onoff";
Adafruit_MQTT_Publish lastwill = Adafruit_MQTT_Publish(&mqtt, WILL_FEED, MQTT_QOS_1);
Hello. I need help completing some lab assignments. Is anyone good with not just Adafruit Circuit Playground but also programming it wiith C# via SerialPort?
@sacred depot You may want to ask in #help-with-projects, this is the Adafruit IO/IOT channel
I have 11 feeds that all seem to have been disabled a month ago. I did not disable them. How can I determine what happened and, more importantly, re-enable the feeds?
oups :
"""Disabled feeds are permanently locked from editing, cannot receive any new data, and will not be included in full account downloads. Existing data may be downloaded from the feed's page.
Once a feed has been disabled, it may not be reactivated."""
That's a pretty big problem. How could they have been disabled without me purposely doing it?
@wary wharf Did you previously have an Adafruit IO+ subscription?
Yes.
@wary wharf do you currently have an active IO + subscription?
I do but it lapsed.
@wary wharf What happened was the account transitioned from IO+ to IO Free, reducing the feed limits from the IO+ account
And that permanently disables the feeds?
@wary wharf We can re-activate the feeds, it's not a user-facing feature since someone could exploit the feed deactivation process.
OK. That's very good news. What do you need from me?
@wary wharf If/when you reactivate Adafruit IO+ to increase the feed limit on your account, use the feedback form at https://io.adafruit.com/support and someone on the Adafruit IO team will re-activate the feeds.
OK. Thanks very much.
@wary wharf No problem! Sorry for any confusion about your feeds, we'll get them up and running again 😃 Feel free to ping me in here if you have any other questions!
OK, I'm already signed in to Adafruit.io, and going to /support gives me this dialog, but pushing the button does nothing. I've tried it on Chrome and Safari.
@wary wharf I just noticed that as well, pointed it out to the IO Web team and attached your screenshot. I'm going to PM you the IO support email address (we prefer if you go through the form, it'll be fixed momentarily).
@wary wharf You had 9 disabled feeds, they're reactivated.
Thanks!
Is there a channel for Circuit Playground Express?
I'd like to be able to convert a WAV audio file to play custom sounds
audacity is probably the normal go-to
Hi @round yoke , no channel dedicated to CPX but one dedicated to #help-with-circuitpython and one for #help-with-arduino depending your dev env. If it's more general #help-with-projects should be useful. Welcome
Or even #help-with-audio since it's a sound-related question 😃
Yeah audacity would be what I record with. I might need to write a tool that can take a wave and generate Javascript tone code from that.
Is your goal to accurately reproduce the source sound? Or to make a coarser chiptune/8-bit game version?
Yeah back in my 8086 Windows 1.0 days there was a driver where you could play 8-bit audio over your bell speaker
So it's going to be significantly lower baud, but it'd be nice if you could tell it was talking or something
Aka make a Teddy Ruxpin
This is an old Teddy Ruxpin commercial I remember from when I was a kid. This boy was just trying to share his Teddy Ruxpin with all these kids for show n' t...
What have they done!? https://www.youtube.com/watch?v=QbC_Cz2BY0E
Teddy Ruxpin - The Official Return! Teddy Ruxpin TV Commercial Teddy Ruxpin is back–smart, innovative, cuddly, and more magical than ever! Parents and grandp...
@dusty hawk I ran into the same problem you encountered (‘has no member named 'setFingerprint' ) last night, turns out that my Huzzah Feather didn’t like me upgrading Adafruit IO Arduino library to version 3.2.0. I was able to fix the issue by downgrading the library to version 3.1.0. Hope that works for you.
@sacred depot is this a ESP32 feather?
Or ESP8266 Feather?
You shouldnt need to downgrade Adafruit IO Arduino from latest.
ESP8266 Feather I had been running for months connected to Adafruit IO, all I know is that I remember updating the that specific library a few days ago. Last night I made some minor modifications to a comment line within the original sketch, uploaded to my board, when I ran into this error:
C:\Users\marka\OneDrive\Documents\Arduino\libraries\Adafruit_IO_Arduino\src\wifi\AdafruitIO_ESP8266.cpp: In constructor 'AdafruitIO_ESP8266::AdafruitIO_ESP8266(const char, const char, const char, const char)':
C:\Users\marka\OneDrive\Documents\Arduino\libraries\Adafruit_IO_Arduino\src\wifi\AdafruitIO_ESP8266.cpp:21:12: error: 'class axTLS::WiFiClientSecure' has no member named 'setFingerprint'
_client->setFingerprint(AIO_SSL_FINGERPRINT);
^
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.
The only variable that had changed, was the library - So I downgraded it, uploaded the sketch again & it started working as before.
@sacred depot What version of the Board Support Package are you running on the ESP8266?
Tools->Board
My understanding from Adafruit's Huzzah tutorial page, is that only 2.4.2 is compatible (which I'm still using)? As firmware 2.5.0 for the ESP8266 breaks compatibility with ArduinoHttpClient (which is used by Adafruit IO).
@sacred depot Yes, but, Adafruit IO Arduino has been updated to work with ESP8266 v2.5.1 and beyond
Can you send me the link to the guide? That text should've been removed.
Adafruit IO Arduino 3.2.0 has ESP8266 BSP 2.5.1 support via https://github.com/adafruit/Adafruit_IO_Arduino/pull/89
unless there's something I didnt see...
uitIO_ESP8266.cpp:21:12: error: 'class axTLS::WiFiClientSecure' has no member named 'setFingerprint'
axtls is pre-2.5.1
Ok
Please make sure you are using the following configuration:
- ESP8266 Board Support Package 2.5.1
- Adafruit IO Arduino Library v3.2
- Adafruit MQTT Library v1.0 (or above)
https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/using-arduino-ide.
However I have tried the later firmware versions this evening including 2.5.1 & 2.5.2 on my Feather & they don’t appear to work on my Feather. It hangs & appears to do nothing. All I get in an endless stream of dots like this ‘...............’ in my serial monitor
@sacred depot Are you using the lib versions I listed above?
Yes, at the time of my last test around 6pm, I had all the lib version exactly as you listed..
hrm
did you test 2.5.1 or just 2.5.2?
Asking bc I'm going to replicate this in a bit and patch if it needs it
Pretty certain I tried 2.5.2, then 2.5.1 with the same result. I only got things working again when I reverted to 2.4.2 & Adafruit IO Arduino back to 3.1..0. I shall try again shortly or first thing tomorrow & grab some screenshots this time. Regards Mark
Huh, I’m deeply annoyed with myself, could have sworn blind I updated all the libs etc before trying 2.5.2. I just tried firmware 2.5.2 again; with all of your exact configuration suggestions and it’s started working perfectly. No endless ‘........’ in my serial monitor. Many thanks for the assistance & sorry if I’ve wasted your time. Regards. Mark
Fair to say the guide definitely mislead me a little 😀
Hmm, since upgrading to 2.5.2 last night I seem to have another odd thing this morning. My sketch is monitoring the humidity & temperature values every 5 minutes and sending the data to Adafruit IO. Today I've noticed that although my serial monitor is seeing those readings every five minutes, Adafruit IO is only recording the values every 10 minutes. Not a big issue for me, but I'm curious as to why it's happening? Regards Mark
Attached is a jpg of my temperature feed, both before and after flashing with 2.5.2 ( which happened at approx 11.50pm). I've made no change to the code, but as shown prior to upgrading to 2.5.2 the data was being received every five minutes. Afterwards IO is shown as receiving the data every 10 minutes. The relevant section of my code is as follows (as you can see it should be sending every five minutes):
// io.adafruit.com, and processes any incoming data.
io.run();
sensors_event_t event;
dht.temperature().getEvent(&event);
float celsius = event.temperature;
float fahrenheit = (celsius * 1.8) + 32;
Serial.print("celsius: ");
Serial.print(celsius);
Serial.println("C");
Serial.print("fahrenheit: ");
Serial.print(fahrenheit);
Serial.println("F");
// save fahrenheit (or celsius) to Adafruit IO
temperature->save(celsius);
dht.humidity().getEvent(&event);
Serial.print("humidity: ");
Serial.print(event.relative_humidity);
Serial.println("%");
// save humidity to Adafruit IO
humidity->save(event.relative_humidity);
// wait 5 minutes (300000 milliseconds == 5 minutes)
delay(300000);
Cheers,
Mark
I purchased an Adabox 003: the code is from Adafruit IO Basics: Temperature & Humidity tutorial.
Hi @sacred depot , cound you try to publish a counter instead of temp and display the same on the serial terminal ?
So you could easily check if if it a period problem or an AIO problem
And display also the return from publish to AIO (ok, error, ...)
Hmm working perfectly, most strange
yes but it is no more 5 minutes. So you changed multiple items. Difficult to compare
I think that io.run() must be called with a minimum period. Is 5 minutes too long ?
Okay 1st test sending every 3 seconds was okay, 2nd Test at 1 minutes was okay, 3rd test at 5 minutes just failed.
Rather than a long delay you may want to execute loop more often , but only call AIO every 5 minute That is, have a 1 second loop, but only call AIO every 300 loops.
As io.run() includes it's own timer you should do something like :
io.run();
if (time expired )
{
publish...
}
} ```
Thanks All, I'll make some changes, it's been working away merrily sending updates every 5 minutes for months; least until I updated things last night. Time I started reading the documentation more thoroughly. Many thanks Mark
I'm having issues getting this Bluefruit LE UART Friend to connect to the bluefruit app to send data to a phone via bluetooth. Anyone have time to take a stab at helping?
I'm using an ItsyBitsy M0 Express as the main board and I have a BN0O55 Absolute Orientation Sensor to get orientation data that will eventually be sent over bluetooth to display on a phone. I just cant for the life of me figure out how to get the data pushed over bluetooth. I'm VERY new at all of this, don't really even know the code to be honest. Just hacking away at it.
@solemn blade This is the Adafruit IO Channel, that question is more suited for the #help-with-projects channel, try posting there
Hi, wondering if it possible to change the micro-USB port to a USB-C port on the Adafruit Feather nRF52840 Express?
@quasi dragon it's tricky because the pcb footprint of the connectors is different
Oh ok might just buy an adapter and put it in my case
@shell star is Adafruit going to be moving feathers to USB-c anytime soon or?
eventually but probably not soon
Ok thanks for your help!
I suggest you try to build the project one piece at a time. First get something simple (like the INA219 or the relay) working, then hook them together so the relay operates when the INA219 gets above or below a voltage you select). Then attack the more subtle and complex problem of doing it via AdaFruit IO. Trying to do everything at once runs a high risk of frustration.
ok thank you 😃
Hello Can anyone send a link how to update data or delete it on the cloud but from arduino code
@sacred depot Hi! What library are you using with your Arduino? Adafruit IO Arduino or Adafruit MQTT?
i am using #include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
@sacred depot To publish, https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/examples/adafruitio_secure_esp8266/adafruitio_secure_esp8266.ino#L98
Dear @royal rapids brentr thank you for your Help, but I know how to publish to the cloud but let us suppose I want to read from the data on the cloud or look for a certain record on the Cloud and Delete it
@sacred depot Unfortunately, you can't use Adafruit_MQTT to delete data. The MQTT protocol can only be used to add data and to receive notifications when data has been added.
deleting data will have to happen through the HTTP API: https://io.adafruit.com/api/docs/#delete-data-point
you can use any Arduino HTTP client to make that request, but it's not built into our Adafruit IO Arduino library
but, depending on what you're actually trying to accomplish with IO, deleting data points may be harder than just leaving them alone
what are you trying to do with your project?
thank you Mr. @novel ember first i will read these link you sent to me and if i had something i did not understand i will ask you again , thanks a lot
👍
regarding updating and deleting individual data points: IO has support for those actions, but in a typical Internet of Things project--say a sensor-based device--it's better to add a new data point when the value the sensor is receiving changes
hey guys, i'm looking for information on the webhook rate limits for adafruit.io
i have a feed set up and am sending data from a huzzah from it quite frequently, but my webhook has only been fired twice (both times it got a status of 200 from my local server via ngrok)
Hello I am trying to get Data from Adafruit Cloud i have two records of data as you see in the pitcture i want to get them and display them on the Arduino Serial Monitor but i am getting some problems and here is the Code https://codeshare.io/aJn4q6
@sacred depot start with the adafruit.io examples
install Adafruit IO Arduino library
from libraries manager
you may need to install some others like http client etc.
then go to file>examples>Adafruit IO Arduino
plenty of stuff to get you going there
Hello Mr. @jolly crystal my question can I by using this library to do update , delete or read for a specific record from the data saved in a certain feed , because someone else adviced me to use Arduino HTTP client , if want to do update or delete on a certain data record even , and i am getting Error when i am using this library like this one
Does your config.g configure AdafruitIO_Feed.h?
@sacred depot Could you copy and paste the config.h file into https://gist.github.com/ and share the URL?
Hello Mr. @eternal cliff and Mr. @royal rapids thank you from your help that is the code https://codeshare.io/GkYRzx and that is the Config.h File https://codeshare.io/5eLR3J and that is the error and board name
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
getting this errors while printing Adafruit GET request on adruino serial monitor
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS, PATCH
Access-Control
llow-Headers: DNT, Origin, X-Requested-With, X-AIO-Key, Content-Type, Accept, Authorization
getting this errors while printing Adafruit GET request on adruino serial monitor, and not getting the html code
That's the code twice, not the config file
@storm wraith Could you provide me with more info such as the error text?
@sacred depot I don't see a config.h file included with your code.ino file. You'll need one in the same folder as your code.
i'm trying to get data on the nano board via adafruit command , i am using nano with a wifi module , so firstly i was trying to read the html code via adafruit get request and using conditions to get the selected result on the harware
@eternal cliff i have changed it check it again please
that is the Error message @royal rapids https://codeshare.io/GAzlnl
@royal rapids please check this out
@storm wraith The GET request, if incorrectly provided to Adafruit IO should return with a response code.
bro can you help me with the correct request fromat
api/v2/{username}/feeds?X-AIO-Key={key} @royal rapids
@storm wraith Please check http response error code, or text and tell me what it is.
I can't help debug with just the request information and no error
here is what i'm getting in return on serial monitor instead of HTML code of GET request
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
Access-Control-Request-Method: *
Access-Contro⸮)⸮⸮⸮ݵMethods: POST, PUT, DELETE, GET, OPTIONS, PATCH
Access-Control-Allow-Headers: DNT, Origin µRequested-With, X-AIO-Key, Content-Type, Accept, Authorization
Access-Control-Expose-Headers: X-Pagination-Limit, X-Pagination-Start, X-Pagination-End, X-Pagination-Count, X-Pag
https://io.adafruit.com/api/docs/#errors < AIO should also return an error code
Access-Control-Allow-Credentials: false just tell me the solution of this ????/ @royal rapids
ok Mr. @royal rapids i am trying another code to get and read the Temperature from data I have on the cloud but that is what I am getting it is not error but I don't know what does it mean, here is the code https://codeshare.io/5M31yO and you can see the records on the cloud that I want to get them and read them , i mean why i did not get the Temperature value and here is the Code https://codeshare.io/5QL1jq
Please anyone help me with this
@sacred depot Where did you get that code from? URL?
@storm wraith Those are the http response headers. how are you printing that info ? Are you doing this over cellular data module ?
@royal rapids I got this code from this example https://www.youtube.com/watch?v=Qw4Iw5s3QOY&t=197s by the way he does not speak English, I don't know what language but I copied the code from the video
Odczyt danych z serwera io.adafruit metodą HTTP GET fajnysoft@gmail.com
@mighty ridge nope i was just trying to print the HTML code of adafruit GET request , bet instead of that i'm getting this response headers......., all other weblinks are working fine but this adafruit link is giving errors
@sacred depot You're getting redirected to https.
i have a question
is there anyway to import time stamped data inti the cloud?
like if i have a database in influx DB, is there a way to overlap data during a certain period
Hello Mr. @abstract mica what do you mean you are getting redirected to Http , why i can not get the value of the Temperature do you think there is mistake with the url variable in the code ? please help me
you need to use SSL
Mr. @abstract mica colud you please help me how to implement the SSL in the code ?
Hi Mr. @abstract mica i tried to use WiFiClientSecure.h insted of WiFiClient.h and i have changed the port to 443 instead of 80 but not it is giving me Connection is Failed , please look at the photos also , really i dont know what to do and here is the Code https://codeshare.io/5QL1jq
@abstract mica @royal rapids do you think the problem with these lines String url="/api/v2/";
url+=adaUser;
url+="/feeds/temperature/data?X-AIO-Key=";
url+=aioKey;
Serial.print("Requesting URL :");
Serial.println(url);
client.print(String("GET /") +url+ " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n" +
"\r\n"
);
@abstract mica @royal rapids Thank you all now it is working the mistake was String url="/api i just changeed it to String url="api
Cool. And we appreciate you pointing out what the fix was!
@sacred depot Glad it's working!
Malformed URLs are probably one of the top causes, but it's hard to debug IOT projects.
thank you Mr @royal rapids , @eternal cliff but now i faced another problem , how to do post and put , i dont know where to put the value in the URL :api/v2/Hero1980/feeds/temperature/data/0E6SH9M3Z1KVVAZMAPBH9ZJ5Q8?X-AIO-Key=a10ccd9585ea41208b7a2cd346e8d139
For POST and PUT methods, the data doesn't go in the URL, it's sent separately.
The data is part of the 'Body Parameter's, the URL is the 'Path Parameters' on the IO API
Since you're doing it at a low level, you may have to do it manually, something like this: ```c
client.print(String("PUT ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n" +
"\r\n" +
"key=value");
Basically the data follows (in CGI format or perhaps some other encoding) after the double newline after the headers.
You'll likely also need a Content-Length header as well, giving the size of the data.
Also, a Content-Type header giving the encoding of the data (application/x-www-form-urlencoded, application/json, etc.)
anyone had a 502 error before?
i'm getting it when a Trigger triggers a webhook post
my webhook server isn't getting anything
it's been running fine until now
i can hit the webhook via curl, from my local machine and another computer
<@&327289013561982976> any ideas on who to contact re the above? I've changed nothing within my app, I can hit the web hook from other machines and even using online curl tools and api testers... the Trigger says it's being called but the webhook isn't being received. I upgraded to + for this functionality and it's a showstopper for a project I am demoing on Thursday right now. Any help would be massively appreciated!
@jolly crystal Hi, have you submitted feedback via the feedback form on Adafruit IO?
@eternal cliff @royal rapids please what i have to put instead of "Key=value " to update the value in the PUT Request client.print(String("PUT ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n" +
"\r\n" +
"key=value");
@royal rapids I have not - due to the deadline being so close I hoped for some realtime help on this but if that's the route I should take, am happy to do so
@jolly crystal dont @ the community moderators for tech support, they are here for community moderation only
@jolly crystal http://io.adafruit.com/feedback
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
is a "direct line" to our technical support for Adafruit IO
@vocal berry appreciate that - I was unsure who to flag about this, thanks for the headsup
you can post here, in the forums or in the feedback - we dont offer guaranted instant 1-1 tech support
I guess instead of "key=value", you'd put the data your POST or PUT request is supplying. From the screenshot, I think the required parameter is "datum", which in turn is a "data record" (whatever that is) containing at least the required "value" item.
@jolly crystal Sorry you're hung up on this, the feedback form and the forums do get read daily by the development team.
@royal rapids thanks - am filling it in right now, sorry to bother you!
thanx!
Please anyone help me with this code i would like to update the value in feed record i am getting error here is the code but i know there is mistake but i dont know where String url="api/v2/";
url+=adaUser;
url+="/feeds/temperature/data/0E6SH9M3Z1KVVAZMAPBH9ZJ5Q8?X-AIO-Key=";
url+=aioKey;
Serial.print("Requesting URL :");
Serial.println(url);
client.print(String("PUT /") +url+ " HTTP/1.1\r\n" +
"Connection: close\r\n" +
"datum: 70\r\n" +
"Host: " + host + "\r\n" +
"\r\n");
As I already mentioned, the data for a PUT or POST request goes after the double newline that terminates the HTTP headers. You'll probably have to add Content-Type and Content-Length headers describing your data as well.
Mr. @eternal cliff Please Help me , i did as you told me and added the value after the double newline that terminates the HTTP headers as you see in the pitcutre , but is it right to write datum:20 incase i want the value 20 or to write value:20 and you mention to add Content-Type and Content-Length in the headers and what values i have to assign to them in case i am updating integer value
You'll need to create a data record in AdaFruit IO format, containing at least a "value" item (sorry, I do not know how to do that). I'm not sure what the correct Content-Type is (maybe the one for URL-encoded form data?), and the Content-Length will be the number of bytes the entire data body has.
If you click on some of the other example tabs in the documentation (like "cURL"), you can probably find out at least the expected Content-Type.
It's probably (a lot) easier to just use a library for this (I assume one exists) instead of hand-hacking low-level HTTP protocol.
@eternal cliff do you know kind of library can do that , the question why adafruit did not put any support for this or how to use it , they mentioned in the API Docs few things but no support at all. the problem all my project now depending on Adafruit cloud and i need to do update , delete and add for the feed records and the HTTP protcol is the only way to do this
that is all what adafruit put about update in their website, not even in their examples anyone shows how to do it
AdaFruit did put support out there, there's a library on github complete with example code https://github.com/adafruit/Adafruit_IO_Arduino
Adafruit_IO_Arduino does not work with ESP8266 NodeMCU
@sacred depot no, but it has sample code of how it works on other boards so you can see what the library is doing and replicate it on your board
@sacred depot I'd try poking around the Adafruit_IO_Arduino GitHub repo issues. The discussion in this one may help:
https://github.com/adafruit/Adafruit_IO_Arduino/issues/79
the problem doing it from HTTP protocols it is very easy, i am able to do (GET) and (DELETE) successfully I have the only problem with update(PUT) and (POST), the question why adafruit does not support us from their experts and tell us , the problem i am working in startup ( Smart shower ) and all my startup completely relay on Adafruit Cloud .
Hello Mr. @eternal cliff i did some improvements in the code i am able now to add content type and content length and no problems, but i am still getting the problem with missing value , do you have any suggestion please , i know that i am bothring you but really my whole project relay on this code
I still don't know what the AdaFruit IO data record format is, but (only for example) I'm going to pretend it's JSON. Then your PostData would look something like ```c
String PostData = "datum={"value":"10"}";
The doc page you posted earlier showed that the data was named "datum", so I used that, and it's in the key=value format of CGI/form data. You'll still need to look up what the data record format is, and encode the data in that format instead of the JSON I used in my example, setting the (required, as I pointed out earlier) "value" keyword and the matching quantity you want to send, and you'll probably have to URL encode the string before sending it.
@eternal cliff Wow Finally succeeded thank you so much for your help and your Support Mr. @eternal cliff#500 @royal rapids
hurray!
@royal rapids @eternal cliff @vocal berry I am building this device it is a Smart shower that works by voice and touch Screen and save all data on the cloud like time of showering water consumption users data on the cloud and I am relying completely on Adafruit cloud https://www.youtube.com/watch?v=yURWs2XVjo4&t=64s
hello everyone, I'm wondering if I can get some help regarding sending data to a feed. I'm using python 3.7.3, I'm able to create a feed but am not able to send any data to it. I get the following error when I use send_data or create_data: "Adafruit_IO.errors.RequestError: Adafruit IO request failed: 404 Not Found - not found - API documentation can be found at https://io.adafruit.com/api/docs"
All of the examples in the adafruit tutorials that involve receiving/sending/manipulating data from a feed give the same error.
404 is the "not found" error. How are you setting up the URL?
The docs show URLs like /api/v2/{username}/feeds/{feed_key}/data
Do you have a username and AIO key set up already?
I'm guessing so if you're able to create a feed, but you'll need the feed key returned from that to send data.
I'm using this example to create the feed:
And this example to try to send data to that feed:
with the 'Test' feedname changed to 'Foo' in the second one
I've also tried the send_data example. The error is a bit different this time: "Adafruit_IO.errors.RequestError: Adafruit IO request failed: 404 Not Found - not found - There is no feed with the key 'Foo'.", although it's present in my feeds.
@solemn frost is there a feed with the key test in your IO feed page?
No, I replaced test = aio.feeds('test') with test = aio.feeds('Foo') in send_data ex
Are you sending to a feed name instead of a feed key. Navigate to that feed on Adafruit IO and click Feed Info
The key should be Foo
you're right, the name was "Foo" but the key was "foo"
now both create_data and send_data work
thank you very much
now that this works, I have another question 😃
can you interact with the random generators found under Services->Randomizer the same way you interact with feeds (for retrieving data)? I would like to simulate four sensors using these Random feeds, how would I go about retrieving the latest value in Python?
@solemn frost I added a high-level helper named subscribe_random into the Adafruit IO Python mqtt client: https://github.com/adafruit/Adafruit_IO_Python/blob/master/Adafruit_IO/mqtt_client.py#L211
so a call to client.subscribe_randomizer(RANDOMIZER_IDENTIFIER) will subscribe it for you
and output in an on_message method like: https://github.com/adafruit/Adafruit_IO_Python/blob/master/examples/mqtt/mqtt_viewall.py#L53
@royal rapids thank you so much, I'll have a look at those right away.
@royal rapids me again (can you tell I'm completely new to this?). When I try to run client.connect() with my credentials I get "ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1056)" any idea how I can solve this?
oh, found it, looks like it was a python issue. Needed to run installCertificates.command
yup!
subbing to the randomizer works too
oh, nice.
Hello! I'm trying to connect to Adafruit IO with credentials I'm reading in from an SD card (don't want to hard code passwords). I want to initialise the connection once I've read in the data from the SD card, but it looks like everything needs to be defined at the top and called before the Setup function for IO to work. Has anyone done this before or can point me in the right direction? I'm using an Adafruit Feather Huzzah and an Adalogger feather wing. Thanks.
What language? Can you point to the code you're looking at?
Another similar example is the Example code adafruitio_07_digital_out that comes with the library
Ah, Arduino environment. I might try separating the declaration from the definition. ```c
AdaFruitIO_WiFi * io; // declare the global variable as a pointer
static void setup()
{
// get username, password, etc.
io = new AdafruitIO_WiFi(username, key, ssid, pass);
io->connect();
AdaFruitIO_Feed * digital = io->feed("digital");
I'll admit I'm not sure this would work, but that's the sort of thing I have in mind.
Great idea, thanks! It now compiles, but I'm not connecting to Adafruit IO anymore :/ Can you think of any reason having them declared as global variables, then instantiated in setup would affect this?
Not offhand, but I don't know much about it. It may be worth eyeballing the library source code.
Will do, thanks for your help.
Hi again. Still trying to read credentials off an SD card to connect to Adafruit IO. The current problem is that even though I can get the information as strings or char array or char pointers, the constructor for AdafruitIO_Wifi doesn't think the values are correct.
If I use hardcoded string literals it works, and printing out the values shows them to be exactly the same, but using the variables leaves it trying to connect forever. I've been playing around with null terminators for a while in case there was an invisible difference but had no luck. Anyone got any ideas? Sorry for being vague, will post code if it helps but it's quite a general problem.
Have you printed the literal and the SD-derived variables out as hex values? Checked length of strings/arrays?
I wonder if the constructor is expecting the values to be in PROGMEM or something.
I like this graph. A/C unit effects on temp and humidity.
Can you somehow get YouTube live notifications to show up in Adafruit IO? I'm trying to make a ticket that shows when there is one of my channels broadcasting live, and I thought this might be the best way to do it
@tame harness where will the ticker live? on your website?
@royal rapids the ultimate goal is to have a raspberry pi ticker that sits on my desk and has a scrolling ticker that shows when those shows go live. my understanding is that it is easier to pull data from IO to put on a ticker than most other ways (i may be wrong), but i thought it would be a good place to funnel the data through
@tame harness Have you looked into using a webhook to accomplish this?
@royal rapids the biggest problem is that anytime i try to search the solution my search includes "youtube" or "live" and it keeps sending me to youtube haha, instead of showing me how to get data from youtube haha. I can look into a webhook, i havent really used them much before, but i have heard about them (im still pretty new to this).
We have a great article there, incl. a video with LadyAda explaining Webhooks and Adafruit IO
the video shows twitter, but there's probably an endpoint for Youtube's API somewhere out there
@royal rapids awesome! i will check it out! There is so much to learn, but i think it is a lot of fun! thank you for helping me with the next step!
@tame harness absolutely - once you're ready or if you have any other Qs let me know
you'll want this library if you're using a Raspberry Pi https://github.com/adafruit/Adafruit_IO_Python
Hello, I'm working on my first project using Adafruit IO on PyPortal. I'm attempting the weather station tutorial. I'm trying to use this to troubleshoot : https://learn.adafruit.com/adafruit-io-basics-airlift/circuitpython I'm seeing the following error: File "code.py" , line 16, in <module> Importerror
cannot import name IO_HTTP
which is very strange since I have that library installed
Is there a way to use websockets with Adafruit io. If so what port number would it be. It sounds like 8000 is commonly used.
@winter fjord I just updated Adafruit IO Arduino yesterday, and it hasn't been picked up by the Bundler. Try updating the library to the latest release found here:
you'll want to download the file: "adafruit-circuitpython-adafruit_io-4.x-mpy-2.0.0.zip"
@royal rapids Awesome, I'll try that out tonight! Thanks
@winter fjord I've also updated the code for the weather station to use the new class names.
HI, does anyone know anything about Adafruit 3538 AMG8833 IR Thermal Camera Breakout?
@lavish swan, there's a learn guide for it if that helps: https://learn.adafruit.com/adafruit-amg8833-8x8-thermal-camera-sensor
@royal rapids Thanks! I have a new error. It's saying it can't process line 23 and 20 of the airlift basic code. SyntaxError: invalid syntax for line 11 in secrets.py. I followed the exact syntax from the example, and added my aio info.
@royal rapids I got it working finally. Thanks so much!
@winter fjord What was the issue holding you up?
Asking because I'd like to know where/if there was a problem.
And some of us are curious, and more info in the Discord helps everybody.
@royal rapids I got it working finally. Thanks so much!
@royal rapids I was missing a comma in the secrets file.
Yow, I've stared at problems like that for quite a while and not seen them.
I'm having an issue with this https://github.com/adafruit/adafruit-io-camera
getting this error on the Monitor tab on the website: error saving data on /feeds/camera_feed, value cannot be larger than 1024 bytes (1 KB) when feed history is on. 47916 bytes received
I've turned off the feed history, but the error still repeats every 2 seconds, when the Pi tries to update the feed
@rough basalt While history is turned OFF, feed data is limited to 100KB (102400 bytes). If the camera_feed history is indeed turned off, there might be a deeper issue. Could you submit feedback via the feedback form here: https://io.adafruit.com/feedback
Sure. I was planning on tinkering with it later tonight.
Thanks! That'll get it looked at by the dev. team.
Hi, I have a question. I'm preparing a puzzle game for my wife. At the final stage I would like to have a dashboard with a button, which will turn on the LED in our living room when pressed to show where present is hidden. Is it possible to share a dashboard with a momentary button block by a link in a way which will allow to push it? As I understand even if I make a dashboard public it's read only and account needs to be created for read + write.
why don't you just use bluetooth or something?
No specific reason. I just learned how to use Adafruit IO lately, so I thought that it would be a nice opportunity to use it. I have an idea how to realize what I want, thank you for your attention.
Hello all.. I am hoping to find some help with a Gemma M0 when plugging into a windows 10 x64 machine I get the trinet device but with yellow ! and when double tapping reset the pc bings but no folder appears to load software 😦 same with windows 7x64 machine.. if I install the adafruit drivers - the device becomes listed as a tinyusb but still wont pop open the bootloader folder.. I have been having this problem for some time now and am getting very discouraged on the device
I have had the same issues with trinket m0 and v5 😦
I have changed the cables, the usb ports, the laptops .. nothing seems to get me anywhere with these devices
@hallow trail This is the Adafruit IO channel, you might be able to find some help in the #help-with-projects channel or forums.adafruit.com for technical support.
can someone help me find a way to convert the values I get from adafruit io for the color picker such as "#24ff00" to a value in adrunio code that I can use to set neopixel color?
@vestal tapir Does this help? https://stackoverflow.com/a/15693516
I don't offhand if there's a hex parser built in but I think you can use the resulting 32 bit value to set the LED color
I can use it if can turn "#24FF00" into 0x24FF00
@vestal tapir What language are you using?
C++ since I'm using Arduino. I'm using the ESP8266 feather. Probably be easier if I got a Curcuit Python board but this is all I have for now. I figured I need to replace the '#' with '0x' I got that far from having trouble turning "0x24ff0" into an int or unsigned int that the strip.fill function expects
Basically I need convert the string to an int
Tried using atoi but it comes out as 0
Yeah you want a hexadecimal version of atol() (not atoi() which doesn't have enough bit width)
Hi! I'm so close to getting my "roll your own PyPortal Touch-Screen Kiosk" (aka PortKi) app working. The only hurdle now is that adafruit.io doesn't seem to take indirect links, like the kind built by Google Drive, in the PyPortal .image_converter_url method. The app currently saves files to a user's Google Drive, then generates publicly accessible links & shares this w/other json pushed to the PyPortal. Images are saved to the Google Drive as .jpegs and I can get them in bulk using wgets on the PyPortal for snappy page-by-page loads when touches are detected. The problem is that while pyportal.image_converter_url can take a URL like this: https://cdn-shop.adafruit.com/310x233/4116-00.jpeg and converts it to a .bmp, it can't accept a Google-generated sharable URL like: "https://drive.google.com/uc?export=view&id=13N_GStffG3qWdTsgf1PRsyBcr4sMnPLj" Mu spits back a KeyError: content-length shortly after hitting the call.
I'm partial to Google Drive because 1) I already built it using Google's APIs and 2) it's an easy-to-use solution for end users that won't cost me any additional funds to run. I can try to roll something in AWS S3. I've not worked with it before, but am hopeful they'd generate direct links instead of redirects (I haven't tested if this is true), but if I roll this, then I'd have to maintain an AWS tier and keep this open for anyone using the app. If anyone has any suggestions for either: 1) working around the redirect issue (any chance this'll be updated, soon, in adafruit.io?) or 2) if there's some other useful service that can create direct-to-PyPortal, unredirected URLs for .jpegs?
BTW: Apologies for the gratuitous self-reference in the video images (it'll be my office door sign), but this is the kind of touch-screen kiosk the "PortKi" app will allow any user to create, if I can crack this redirect link adafruit.io nut. https://youtu.be/K41v0_z0lbg
@sonic cliff if all the images are generated by your app (or something else under your control), could you generate them as BMP files before uploading to Google or wherever, and then just bypass adafruit.io's conversion entirely?
Thx Mike. I was able to covert them to bmps in the App but for some reason the iOS data conversion bmp can’t be read by PyPortal. When my bmps are opened in Photoshop or Preview they are somehow defaulted to the option showing in Photoshop as Flip row order. Other apps and services seem to read this but John Park noticed the diff in Photoshop. I don’t know enough about working with bmps beyond the standard iOS data conversion to know how to code a change. If you are curious I’ve saved a few of the files in various formats at https://drive.google.com/open?id=1DQYes-cJXKm3ue8Z9cACDLEN5bxnnkJc. Also I haven’t tried a wget straight via the redirect link since I haven’t gotten bmps to save in a pyportal friendly way. I will give that a shot but am not optimistic I can crack the nut on taking bmps beyond what iOS gives me to work with.
I don't know enough iOS development to say for certain, but I used ImageMagick on Linux to do my conversions. Looks like there's an API called MagickWand that works on iOS. https://stackoverflow.com/questions/18267432/ shows one example, but that's not an actual conversion.
Might be able to piece together enough from ImageMagick's API documentation to do the conversion. Trivial from a Linux command line, but that's not really the environment here.
Notes before heading out: the Unix file command reports a negative dimension for the native iOS BMP:
$ file adafruit-*bmp
adafruit-log-as-iOS-created-bmp-then-converted-online-shows-in-PyPortal.bmp: PC bitmap, Windows 98/2000 and newer format, 320 x 240 x 24
adafruit-log-as-iOS-created.bmp: PC bitmap, Windows 3.x format, 320 x -240 x 24
And the raw binary data isn't identical up front (or possibly anywhere):
$ od -c adafruit-log-as-iOS-created.bmp | head
0000000 B M 6 204 003 \0 \0 \0 \0 \0 6 \0 \0 \0 ( \0
0000020 \0 \0 @ 001 \0 \0 020 377 377 377 001 \0 030 \0 \0 \0
0000040 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000060 \0 \0 \0 \0 \0 \0 377 377 377 377 377 377 377 377 377 377
0000100 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
*
0022040 377 377 377 377 377 377 377 377 377 377 377 377 377 376 376 376
0022060 377 377 377 377 377 377 377 377 377 377 377 377 376 376 376 377
0022100 377 377 377 377 377 377 377 377 377 377 377 376 376 376 377 377
0022120 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
$ od -c adafruit-log-as-iOS-created-bmp-then-converted-online-shows-in-PyPortal.bmp | head
0000000 B M 212 204 003 \0 \0 \0 \0 \0 212 \0 \0 \0 | \0
0000020 \0 \0 @ 001 \0 \0 360 \0 \0 \0 001 \0 030 \0 \0 \0
0000040 \0 \0 \0 204 003 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000060 \0 \0 \0 \0 \0 \0 \0 \0 377 \0 \0 377 \0 \0 377 \0
0000100 \0 \0 \0 \0 \0 377 B G R s 200 302 365 ( ` 270
0000120 036 025 205 353 001 @ 3 3 023 200 f f & @ f
0000140 f 006 240 231 231 \t < \n 327 003 $ \ 217 2 \0 \0
0000160 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 004 \0 \0 \0 \0 \0
0000200 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 377 377 377 377 377 377
0000220 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
the negative y dimension is the "flow row order", but it looks like there may be other metadata changes
location = self->data_offset + (self->height - y - 1) * self->stride + x * bytes_per_pixel; can only go poorly with a negative height
Thx for the heads up @ocean eagle & @abstract mica I tried using wget from PyPortal to a direct bmp file without referencing the image_converter_url & couldn't fetch from a Google Drive URL like this "https://drive.google.com/uc?export=view&id=13N_GStffG3qWdTsgf1PRsyBcr4sMnPLj" - got a "NotImplementedError: Redirects not yet supported". But the call works fine if it's a direct URL like "https://cdn-shop.adafruit.com/1200x900/3055-06.jpg". The info on the bmp confirms that there are differences & although Photoshop & Preview are forgiving & still call these BMPs that can be loaded, changed, and re-saved, PyPortal doesn't like the format - unfortunately I'm not sure how to manipulate things at the bit level. Using the adafruit.io conversion isn't such a big deal if I can wget with the conversion and save the files to the PyPortal in advance of the user's first touch on the touch-screen kiosk (I can load files, locally w/each touch), but I'd still need to solve the adafruit.io redirect problem to get this to happen.
For ex: This code works:
image_url1 = "https://cdn-shop.adafruit.com/310x233/4116-00.jpeg"
pyportal.wget(pyportal.image_converter_url(image_url1,320, 240,color_depth=16), "saved1.bmp",chunk_size=512)
pyportal.set_background("saved1.bmp")
Another curious thing happens to files. The code above's wget will save a file and I can continue to call pyportal.set_background("saved1.bmp"), alternating with any other files I've wget'd in advance, as well. The files saved to disk work, but only for that "run" of code.py. If, for example, the executing code stops, I comment out the wget calls, and just try to do a .set_background with the .bmps that are on the PyPortal, this error occurs when hitting .set_background: OSError: [Errno 5] Input/output error. Not a huge deal since, if there is an electrical outage or some other reason, I can download the files at the start of the program, then reuse them in a while True: that continues to wait for and respond to user presses, but it'd be good to get some sort of file persistence. Is there some sort of additional call I should be making after the wget so that these files are usable after the code is done executing? When I try opening these .bmps stored from a wget in a tool like Photoshop or Preview, I also get a "could not complete request because of disk error".
Not sure about the disk error. For my current single-URL use case, I make a copy of the previously-downloaded image before the next wget, and revert to the saved image if the new download fails for whatever reason. Writing redirect code into the esp32spi requests module probably wouldn't be too hard, but not sure what exactly would be involved. Might be worth seeing if imgur provides easier direct links to images, too -- https://apidocs.imgur.com/?version=latest -- you writing a free app shouldn't incur any costs from them. Host original images through imgur, point adafruit.io at those instead of Google Drive.
API Status
Status for the API can be found at status.imgur.com!
Getting Started
Imgur's API exposes the entire Imgur infrastructure via a standardized programmatic interface. Using Imgur's API, you can do just about anything you can do on imgur.com, while using your programmi...
Hi Mike, Thx. I did some quick tests and the straight wget on bmp wasn’t much faster than jpeg going through Adafruit.io so for this first round I stuck with Joey. If I can figure out a solution on bmp I can switch. You’re right about wanting a free api. I did get Amazon aws to work but it’ll be a pain for end users to go through the extra steps of configuring their own. I tried imgur but had a hard time getting the Mac api working so I moved on to aws. I hope to write up a step by step install for anyone who wants to try the code. It’s still really alpha ish but works. Here is a 1 min vid of it in action: https://youtu.be/XVfCQ6XWwH4. If anyone wants an early look at the gruesome code before I clean and improve things, the swift and python code are both at https://github.com/gallaugher/PortKi
Hi all, can anyone running Android recommend a widget app for reading Adafruit IO values? Ideally something where the icon on the Android homescreen comes from an Adafruit IO value
really random question adafruit io full set 60 data points per minuite is there a way to get more or is 60 the max ? ( this is all thearerecical idea at this point )
Looks like 30 per minute for free accounts, and 60 per minute for Plus accounts. What's the application for needing more? (Not a representative of adafruit, just curious).
i volunteer in a vintage arcade we are looking in to the feasibility of rolling out temp and voltage senders out to inform us of problems so that would be min 300 machines with two feeds each making it 600 sending data every 5-15 mins . suppose i could find away to stagger them over the 15 mins ? . but as i said its all theoretical and we might find only a few machines would need it
If all you're doing is data logging, rolling your own time series database with influxdb or prometheus might be an option. https://www.definit.co.uk/2018/07/monitoring-temperature-and-humidity-with-a-raspberry-pi-3-dht22-sensor-influxdb-and-grafana/ shows one writeup. Front with Grafana or similar, and you might be set with a cheap VPS or onsite host.
Thanks will have a look . We were looking into have programs subscribe to the feeds as well to tell us if there are problems so there was more
influx is so exspencive and you only get 15 more data points
promethus might be ok
I meant to self-host influx or whatever. Didn’t even know they had a hosted product.
promethus ill be looking to more 😃 as its open source
Influx is also open source.
ok ill have anouther look 😃
I'm new to Adafruit IO and I'm trying to represent rainfall (mm/hour). What is the best way to do it? There is no barchart block
@split forge The line chart may be useful
you can select to use a Stepped line graph, which is useful for representing logic levels (may be useful for rainfall too!)
Oké, I will give steppe line graphs a try.
Hi, I have a problem with sending float values to IO feeds. There is a tutorial on Learning System where floats are logged so I assume that it should be possible (https://learn.adafruit.com/search?q=io dht22). I'm using Arduino Nano 33 IoT and BME280 sensor. Here is my code: https://pastebin.com/m5zeJ6jX (I'm not using the code from mentioned obove tutorial because I don't understand it). If I change data types in lines 113-115 to uint32_t they are logged, but obviously as integers. Any suggestions are welcomed as I'm lost.
I got to the point where things got really weird. First of all I realized that I can't send float value just like that, I should convert them to strings. So I tried that for temperature value for start. Result? Temperature value is not recognized on server side, but float values of humidity and pressure which I send after the string are now logged. How come? My current code: https://pastebin.com/si9ZtsTK
And this is confirmed. I created dumb feed to which I send empty char[1] before sending floats. Now all 3 float values are logged.
I will leave my final code here, maybe someone smarter will like to look at it: https://pastebin.com/15rdBtep This code works, it sends three float values which are logged in IO. At the very bottom I added a function to convert float to string. It's not used in the code, but if you remove it, float values are not logged in IO. I have no idea what is going on. Maybe by an accident function with the same name is called by one of the libraries?
@lethal horizon Hiya, we have a comprehensive example showing type conversions to/from Adafruit.io in Arduino over here: https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/examples/adafruitio_05_type_conversion/adafruitio_05_type_conversion.ino
Thank you @royal rapids for pointing me this, I'll look at it.
@royal rapids It took me2 hours to realize that Adafruit forked WiFiNINA. I had Arduino version installed and got compile error that WiFi class has no setPins method. And it's true, there is no such method in Arduino version. That was tricky.
@lethal horizon Yeah, you must use the Adafruit WiFiNINA library with Adafruit IO Arduino. Possibly I could put a warning into the config.h? Would that help you?
I think that it should be noted somewhere to avoid such errors.
I've noted it on the guides which reference WiFiNINA/AirLift
@royal rapids Hello! A few days ago I asked for tje best way tp represent rainfall data in Adafruit IO. Th stepped line graph you recommend me works fine! Thank yoy very much. And and I apologize for my lack of english...;
@split forge Looks good!
@sonic cliff Maybe I'm misunderstanding, but I wonder if Google has some anti-bot defense in place., or just that there is no direct link to an actual image (perhaps to thwart hotlinking). In the browser, the Google Drive URL shows a web page with an image in an HTML <img> tag (but the img URL is not just a static image file), but cURL gives HTTP Error 400 Bad Request. Could be as simple as User-Agent, but also could be some JavaScript and redirect. Maybe have PyPortal dump the full response headers and response body to see all that Google is returning.
Is it possible to make a dashboard that uses data from a shared feed?
Hello I have Problem with posting data using C# to Adafruit cloud it is not working but when i use smiller library using C ( https://codeshare.io/5olvNM ) it works fine but with C# not working here is the Code With C# ( https://codeshare.io/29wVEK )
I have Solved the Problem it was Because i missed to Add Value Word in the URL , it works from Console project in visual studio but when i run the code from Lambda project it does nothing , no change on the Cloud Records
I'm new to adafruit.io - having trouble just signing in. If I click "sign up now" at io.adafruit.com I get redirected to accounts.adafruit.com where it tells me "You are already signed in."
Is there a better login page, maybe?
Dev tools in Firefox shows HTTP 500 from https://io.adafruit.com/api/v2/user
Request in question has Authorization: Bearer header filled out. This rq is sent by Firefox when I visit https://io.adafruit.com/
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
If I'm logged in to adafruit.com when I visit, the response is HTTP 500. If I'm not, the response is HTTP 401.
The "send feedback" link doesn't work, maybe for the same reason (it doesn't recognize my active login session). Clicking the "sign In" button there has no effect.
hello Im new to Adafruit IO. I have successfully send sensor to feed from default group. My question is how shall I send sensor data to particular feed inside a group?
try:
# if we have a 'Air Quality Index(AQI)' feed
pi_AQI = aio.feeds('AQI')
except RequestError:
pi_AQI = aio.create_feed(Feed(name='AQI'))
Hello i am Trying to publish value to feed using MqttClient in C# but it not working MqttClient mqttClient = new MqttClient("io.adafruit.com"); byte code = mqttClient.Connect(System.Guid.NewGuid().ToString(), "Hero1980", "a10ccd9585ea41208b7a2cd346e8d139");
mqttClient.Publish("/feeds/photocell", Encoding.UTF8.GetBytes("40"));
mqttClient.Disconnect();
can anyone help me with this please
@sacred depot Do you see your MQTT client connect on the monitor page? http://io.adafruit.com/monitor
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
@sacred depot you may want to edit that message to remove your Adafruit IO Key, too.
@visual fiber Feeds within a group begin with the name of the group, then the name of a feed, separated with a .
for example, if I was sending data to a feed named humidity inside a group named weatherstation, i'd send data to the weatherstation.humidity feed
For your purposes, it'd be: pi_AQI = aio.feeds('GROUP_NAME.AQI')
Dear @royal rapids it connects to Adafruit Server but the problem when publish command line i miss something inside it mqttClient.Publish("/feeds/photocell", Encoding.UTF8.GetBytes("40")); why there is no example using MQTT with c# to publish and subscribe to Adafruit
i can do HTTP Request using C# to adafruit cloud and it works fine but MQTT till now i did not success
@sacred depot If your client is indeed connected and publishing, you should at least see an error on the monitor page.
It may be an odd configuration with your MQTT client - I suggest spinning up a Mosquitto MQTT (https://mosquitto.org/) server OR testing your client against a public broker (https://test.mosquitto.org/).
If you're sending data to Adafruit IO's encrypted MQTT server (port 8883), try sending data to our unencrypted port (1883) to ensure it's not an issue with the SSL certificate. - https://io.adafruit.com/api/docs/mqtt.html#mqtt-connection-details
Also - worth checking, the feed format you have is incorrect, you'll want to send to your_adafruit_io_username/feeds/photocell, not /feeds/photocell (https://io.adafruit.com/api/docs/mqtt.html?cpp#feed-topic-format)
Thank you @royal rapids Finally it works
i just changed publish command to this mqttClient.Publish("Hero1980/feeds/photocell", Encoding.UTF8.GetBytes(Convert.ToString("77")), MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, true);
Dear @royal rapids thanks for the reply. I have followed your instruction but i couldn't get the expected result. And yet another problem arise when i tried to add more data to previously-created feed.. I have to delete the former feed before running the code.
Here's the code I tried. I managed to create the group at my io account but couldn't manage to create feed inside that particular group.
try:
group = aio.groups("Air Quality Index")
except RequestError:
group = aio.create_group(Group(name="Air Quality Index"))
try:
# if we have a 'Air Quality Index(AQI)' feed
pi_AQI = aio.feeds("Air Quality Index.AQI MyLocation")
except RequestError:
pi_AQI = aio.create_feed(Feed(name="Air Quality Index.AQI MyLocation))
aio.send(pi_AQI.key,int(aqi))
@sacred depot Awesome! We have a cookbook (https://io.adafruit.com/api/docs/cookbook.html#adafruit-io-api-cookbook) of sorts for various Adafruit IO how-tos like publishing with C#, which don't fall into any specific category. It'd be appreciated if you could contribute some of your C# knowledge in the form of a pull request there: https://github.com/adafruit/Adafruit_IO_Documentation/pulls
@visual fiber What do you mean by you "couldn't manage to create feed inside that particular group."? Could you take a screenshot the adafruit io web interface so I could take a peek?
What am I doing wrong? Adafruit.io thinks I'm not logged in. But when I click the Sign Up Now link, accounts.adafruit.com says I'm already signed in. When I click Send Feedback on adafruit.io, I get another Sign In button that, when clicked, does nothing.
How do I log in to adafruit.io?
I would ask via the feedback form, but that requires me to be logged in first...
dear @royal rapids , here's the error message I got from running the code.
for adafruit io web interface
no feed is created under 'Air Quality Index' group
I'm trying to get a chromebook to display a permanent live view of the adafruit IO dashboard I am setting up which will show when people are in or out of the office using their wifi connection and IFTT to update their binary statuses (IN/OUT). I have switches that show these statuses on the dashboard, and these toggle when IN or OUT is sent from IFTT to the feed. The switches can also be manually toggled on the touch screen of the chromebook which updates the feed. Problem is that the page seems to 'timeout' and the switches won't toggle after a certain time if IFTTT updates the feed. I tried using a chrome extension (Staying Alive and others) to send requests and/or refresh the page at set intervals. This doesn't fix the issue. Strange thing is, that if I toggle the switch manually on the chromebook, the feed is still updated, but the switch still won't toggle from feed updates from elsewhere. Can anybody help with this?
@supple turtle Hi - could you check the IFTTT applet history? IFTTT applets seem to send their status to adafruit io feeds every ~15min.
@loud field Thanks for submitting a bug, I submitted the bug to the development team.
@visual fiber Could you try creating the AQIMyLocation feed within the Air Quality Index group, from the website?
@royal rapids If I look in the IFTTT activity feed it shows the applets are running as they should - only send an update when connected or disconnected to the wifi. The adafruit IO feed is correctly receiving this and updating , but the dashboard doesn't update after being loaded for a while. I also have a nodeMCU connected via MQTT with an LED which shows when I am in or out of the office and this updates as it should, demonstrating that it must be a dashboard /browser thing
@supple turtle I've filed an issue for the keepalive with the dashboard issue you're having with the development team. I'll ping you when I know more information about it.
Hello. Is it possible to use someone else's feed that is shared with you in a dashboard?
@rough basalt To clarify, this would be using their shared feed in your dashboard?
Good afternoon! I am trying to play around with my Hallowing Adafruit board for my first project ever (yay) it was a gift from my wife.
Can you all help me, or direct me to the right place to find help?
I am trying to upload a sketch to the board, and it seems to be hung:
The debugger says the following
----------_
Sketch uses 178156 bytes (35%) of program storage space. Maximum is 507904 bytes.
processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2086)
at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
at processing.app.Serial.touchForCDCReset(Serial.java:107)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
... 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
at jssc.SerialPort.openPort(SerialPort.java:170)
at processing.app.Serial.touchForCDCReset(Serial.java:101)
... 6 more
I presume this is because I havent installed the Udev rules right in the etc/udev/rules.d/ directory. I'm a bit of a linux noob so im not sure how to proceed getting those files in the folder. Do i need to move them with sudo access and a copy?
If it's a permission denied, what's the output of ls -l /dev/ttyACM0 and groups $USER (both run as your regular non-root user)?
ls: cannot access '/dev/ttyAMCM0': No such file or directory
either that's a mis-copy/paste to Discord, or from Discord. ttyACM0 is what it was looking for.
username : username adm cdrom sudo dip plugdev lpadmin sambashare
crw-rw---- 1 root dialout 166, 0 Aug 23 15:17 /dev/ttyACM0
Thanks for your help, So am I understanding we just looked for the permissions this user had that I'm logged in as, as well as the permissions sets available to the "users" group?
Got pulled away for a minute. Short version is your user needs to be added to the dialout group that has read/write access to ACM0.
huh neat. Do you have time to guide me to that, or point me to a guide that can show me?
sudo usermod as shown, followed by logout and login. Will absolutely not work without the logout/in.
No ACM0 -> need udev. ACM0 permission denied -> bump up permissions.
Ah, yeah ok that makes sense. I though tmaybe the udev had some kind of agent that req. special permissions. I was kinda right, that agent is me
lol
The ls -l shows which user and group has what rights to the device (treated like a regular file, except that c in the first column says it's a character device instead of a regular file or directory).
groups $USER shows whatever groups the currently-logged-in user is a member of ($USER is immediately replaced by your actual username before running the groups command).
Characters 2-4 of the ls -l show the permissions assigned to the owning user, characters 5-7 show the permissions assigned to the owning group, and characters 8-10 show the permissions assigned to everyone else. So root gets read/write, members of dialout get read/write, and everyone else gets nothing.
So good news is it verified and uploaded
badnews is the hallowing LCD is off, and the LED next to the USB charging port is pusing red
Dear @royal rapids Sorry for late response because i was not online and i did not see your message that is the code from Lambda from Function.cs it shows how to communicate with Alexa intents and send MQTT message to Adafuit cloud and on ESP8266 NODEMCU i have Adafruit Subscribe to listen to Lambda Server Messages and execute what ever is connected to NODEMCU https://codeshare.io/5w688R
@sacred depot I have a question is it possible to Save Photos on Adafruit Cloud ?
You can setup the cloud cam project to send to feeds on Adafruit IO. Using these image feeds you can build interesting dashboards that combine live camera views, sensor readings, and more.
First you'll need to have access to the Adafruit IO beta--right now it's a limited invite beta but will be expanding more over time.
Thank you @brent0898 but how to access Adafruit IO beta ?
Looking for help with a learn guide “Wifi Music Alert Box”. Had it working .. went to make another one .. just gets stuck on the part of the code that checks for an SD card and appears to reset and just beep in a loop
So far I have tired a few things to trouble shoot .. but now I have uploaded the code on the one I had working and it now does the same
MacOSX. Ardunio 1.8.9. All of the latest libraries... esp8266 is set to version 2.5.1 / also tried 2.5.2 and 2.5.0
SD card is a sandisk and another is a microcenter brand SD
Serial monitor has a few lines .. one is “rst cause 2, boot mode:(3,6)”
Also.. esp8266 seems to work just fine .. I did a different Adafruit IO example and it has no issues
Another bit of info on my trouble shooting .. I uploaded the VS1053 example “feather_player” same thing .. beeps .. but it does show the names of the file on the SD card .. so that appears to a really good sign
@topaz viper Possibly try upgrading the firmware on the ESP8266? From arduino ide->board manager->search for "esp8266"
Same thing happens
@visual spire Do you know where in your code is the program crashing? Is it related to Adafruit IO?
I am not able to log into Adafruit IO, is anyone else having issues?
Clicking Sign In goes back to the IO page, Getting Started for Free says I'm already signed in, so I'm a bit confused. I see that bbhacking above had the same issues?
Also tried another browser, logged into it there and then ran in to the same issues
@proud yacht are you still having this issue?
Yes, still am having the same issue. Tried this from my work computer and work internet today and still hitting up the same problem
I also ran into the same issue bbhacking had re: leaving feedback. Tried to report the issue and it says I have to log in first to report the issue but the "login here" button is not doing anything at all.
@proud yacht Ok, I filed a bug for you. Hopefully it'll be resolved shortly.
@proud yacht Can you take screenshots of what you're seeing?
Is anyone else seeing this - If I go to my feeds "page" and select "view all" I see my feeds and they are updating but the "Recorded" time is not updating. they report the data as being 4 hours old.
hmmm -- still says "about 4 hours" on all updating feeds.
My UTC offset is -4 --- could that be relevant -- the time tags on the feed updates are correct in my local time.
examples
@keen dirge is this still occurring on your end?
@worldly wolf Could you file a bug report using the IO Support Feedback form: http://io.adafruit.com/support?
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
Sure. Will do that later today
done
Apple TV ~~~ YouTube no sound ? For Ask an engineer
Might be me .. restarting my A.TV
Sound 👍🏻
I built a weather station that I want to run remotely. Built a service to restart on power blips. Service runs with exception of a fault that says unable to locate Adafruit IO module or close to that. Lot of code was copied from @royal rapids weather project. Done nothing to the Adafruit IO script portion at all. Runs when I start manually from a terminal window or from mu, but not when I run as service. Comment out the Adafruit IO rest client and feed lines and then the service will run. Any suggestions are welcome.
@south gust what version of Raspberry Pi and OS are you running? Should not make any difference, but then again, it should work!
Pi is 3B+ and Raspian Buster
have you tried removine/re-installing adafruit-io -- do you just install it wth pip3 install adafruit-io -- no sudo
I just did the items you listed regarding both blinka and IO. Blinka updated to same version as yours. IO said no need everything current but version same as yours
Its to me like something in regards to the Adafruit IO Rest client is missing or in wrong location but it works as program, just not as service so it's like program knows where to look but service doesn't. That is why I was hunting info on rest client to se where it all gets loaded to and how it is configured but that is what is lacking
I am grasping at straws -- one difference is in my code i have from Adafruit_IO import * can you try that -- I have no idea why it should make a difference.
As far as removing and reinstalling I have not done that yet. Frankly I would have to look up the command to do that. Not that I mind I just a couple of days ago rustled up the appropriate commands to delete directories and files
pip3 uninstall adafruit-io
So you are saying instead of import client you have import *
The original line in my code is from Adafruit_IO import Client, Feed, RequestError
With the Client changed to * it puts out an invalid syntax error
Give me a few minutes to get these commented lines back right
Sorry -- I have to go offline for a few hours -- maybey until tomorrow -- good luck -- I'm baffled
@south gust any progress with it?
not in the slightest
😦 weird -- wish I had more ideas....
My brain is numb. Giving it a break
good idea -- and good luck!
Has anyone done any work on embedding Adafruit IO data into Android widgets?
@sacred depot you may be able to use a MQTT push-widget to subscribe to a feed (https://play.google.com/store/apps/details?id=de.radioshuttle.mqttpushclient),
@south gust How are you running it as a script? Could you post the code, incl. how you're running it.
@royal rapids fyi -- my feeds are still reporting as 4 hours old and I've have no response to my feedback post. Any suggestions on how to proceed?
@keen dirge Feedback was sent via the feedback form?
@keen dirge just read through the tickets, it seems that ticket got lumped with another ticket. Could you re-file it?
sure
@keen dirge Thanks, i've never seen that happen before 😕
ok -- resubmitted.
@keen dirge thanks, please ping me again if it doesnt get resolved .
None of my devices are able to connect to MQTT anymore. I would have thought it was just a hardware issue, but I have both an Arduino and a CircuitPython device that can't connect.
Are there any known issues?
that 4 hour thing doing same in my IO account
Is it possible to launch a discrete web page from IO using one of the blocks such as the momentary button or toggle blocks. Wouldn't be embedded inside IO but would launch a specific page via code.
@royal rapids FYI -- "4 Hours" issue still not resolved and I still have had no response the feedback.
Project question... should I be able to put a
FeatherWing - RFM69HCW on a ESP8266 Feather and have a set up that Adafruit IO feed watches for specific action and then send a RFM69 packet ?
Want to make sure before setting up no pin conflicts or having two radios / wifi and 900mhz would clash with each other
the radios shouldn't care about each other since their frequency ranges are so far separated. It's still possible through the witchcraft of RF that one will somehow overpower the receiver on the other but you're probably ok
Awesome, thanks
The one that causes problem is cellular. The others all seem to coexist reasonably well.
@royal rapids additional info -- If I set the Time Zone of my computer to UTC. Then the "Recorded" time "4 hours ago" goes away. However, this does then show the "Created At" times for each feed UTC as well.
I was suspicious that this is Time-Zone related since I am at UTC-4 (until DST ends...)
Also -- since I have twice posted to the "feedback" system and received no acknowledgement or response I won't bother to follow-up there- I was just trying to point out this issue since it was clearly due to some change. It has not always worked this way. Now that I understand the "4 hours" I can deal with it locally. I am disappointed by the lack of response from the "feedback"
This has been resolved! Thanks!
Don't know if this is the right channel, but I have a problem with ToF sensor VL6180X. From time to time the connection "hangs": no error nor result comes back from the sensor. I have to power cycle the Raspberry Pi to "unfreeze" it. Anyone of you ever had the same problem? Any thoughts/suggestions?
@round path please ask in #help-with-projects
https://twitter.com/brentrubell/status/1176965406118076416 New Adafruit IO Block update!
Set-able Icons and decimal controls are now available for your @AdafruitIO Gauge and Text elements! Now live on https://t.co/KqHgkDD9nQ
#AdafruitIO @Adafruit
Hello , I have a problem in getting barometric pressure values out of bmp388. is this the right forum to ask?
Probably #help-with-projects (general project help), #help-with-arduino (if you're using Arduino) or #help-with-circuitpython (if you're using CircuitPython)?
I am publishing and subscribing to the same feed. It takes my publishes as subscriptions and results in error in working.
@tough grove Could you post the exact error you're getting from Adafruit IO?
I've tried a few of the mqtt Python examples, and I can create a group/feed and publish to that feed, but the subscription never gets any messages. Any ideas what I could be doing wrong? (I've tried def connected(client): client.subscribe_group(GROUP_ID) and client.subscribe(FEED_ID) in the 'connected' callback. The message call back is def message(client, feed_id, payload): print('Feed {0} received new value: {1}'.format(feed_id, payload))
I should clarify that when I publish data using the Python MQTT examples, and using a Webhook URL & Postman for a given feed, the data is visible in the dashboard, but the Python MQTT subscription 'on_message' handler/callback is never triggered.
Hmmm... tried every combination of feed/group/key that seemed to make sense but no dice. Deleted all feeds & groups but for default and now I am receiving messages!?! Oh well, at least its working.
Next question that I hope to be able to solve myself! 🙂 How can I send data using a webhook and a query param? I can send some data using postman and a header value, but I want to be able to use a QR code to trigger some hardware via a feed.
?value=32 on the end of the webhook URL works. I tried that initially but it gave me an error... Anyway that works too. 🙂
Ah wait I was sending it in postman as a POST and I guess the URL from the QR code is a GET. Thats probably why it wasn't working when I tried it first.
I considered asking about GET vs POST, but know little about MQTT or webhooks.
So yet again, you solved it yourself, good on ya.
Well I figured out why it was working in Postman and not a browser, but I really want to send some data from a URL without post from a QR code. Not sure I can do that without some intermediate web page 😦
I did wonder about the dashboard buttons. Maybe I could trigger them externally somehow?
If you can use GET and CGI parameters, it seems to me that you should be able to use that to send data directly from a QR code, but I'm well aware I could be missing something.
I'm not sure the io.adafruit.com webhooks for feeds allow me to do that.
(use get to send query params that is)
Postman works with ?value=32' with POST but fails with "error": "not found - that is an invalid URL, please check the API documentation at https://io.adafruit.com/api/docs to make sure your URL is correct"` when using GET.
Oops, I was thinking generic MQTT webhooks, not io.adafruit.com.
are you waiting for the messages, or is the program ending?
I'm interested in running an mq broker on my server, does anyone have any suggestions?
I'm interested in the smallest/cheapest footprint possible to post humidity and temp to Adafruit IO. Circuit Python is preferred- can someone recommend a board that has WiFi that meets this requirement? I can do it with Raspberry Pi but the maintenance isn't worth it and the cost adds up quick for all the parts
Smallest might be a Feather (M4 or M0 if the code will fit) and an AirLift Wing. Cheapest might be the Metro M4 AirLift (bigger around but less tall than a Feather with a Wing). Another possibility is an ItsyBitsy M4 Express with an AirLift breakout board. Both small and cheap, but you'd have to hand-wire them together.
Awesome, I just found the Metro M4. I'm going for simplicity, but I can wire/solder if needed... time to see what's cheaper, an M0 +Airlift or a Metro M4
Looks like the M0 combo is $2 cheaper and a better fit for me. Thanks @eternal cliff !
@reef oriole I recommend Mosquitto MQTT
@sacred depot Anything with a M4 with an "airlift" module (wifi co-processor)
Bitsy M4 + Bitsywing (uses a very small UBlox ESP32 module) is the current smallest footprint overall
Although you absolutely can use a SAMD21/M0 for Adafruit IO and CircuitPython, the M4 is preferred.
@sacred depot Yep, I mainly prefer it since it can speed up some of the cryptography libraries (like CircuitPython_RSA) used for authenticating with some of the more robust IoT platforms like google cloud iot and AWS IoT
The FeatherWing has an space for an ATECC608A (order one up from DigiKey). That'll help us offload some of the RSA/Crypto functions from the M0 (and even M4)
Thanks- for now I am looking for dead simple temp/humidity to AIO. I have the room so I'll probably go with the M4
I'm using a PyPortal and the sample code to write to Adafruit IO via this tutorial: https://learn.adafruit.com/iot-pyportal-data-logger-adafruitio-circuitpython/circuitpython-code
I'm getting an error where it can't seem to find the existing feed, and it errors out when it tries to create a new one with the same name
For example, my code says: try: # Get the 'grey_temp_a1' feed from Adafruit IO temperature_feed = io.get_feed('grey_temp_a2') except AdafruitIO_RequestError: temperature_feed = io.create_new_feed('grey_temp_a2') and it errors on the last line because it can't find the feed... but the code had already created that feed name previously.
@sacred depot try using dashes instead of underscores in the feed names.
Good call, I wouldn't have thought to try that- after a hard reset that seems to be the fix- thank you @keen dirge
I think I rediscover that every time I create a new project 😉
@royal rapids is the need for dash instead of underscore documented anywhere?
Name - A short descriptive title of your data. Letters, numbers, and spaces are valid characters, and this field is required. The feed name must be unique for your account. it does not say anything about either one
IIRC if you use an underscore at the website, then it silently converts it to a dash in the actual feed name
@keen dirge Asking Adam, I don't think it is, we can add to the API docs.
@sacred depot @keen dirge https://io.adafruit.com/blog/tips/2016/07/14/naming-feeds/
There’s an old joke that in computer science, there are only two hard problems: cache invalidation, naming things, and off-by-one errors.It’s taken us a bit ...
The feed had two underscores in it, that link says underscores are ok
The code I linked to tries to upload to the IO feed, then tries to create it if it failed to read it... so it was giving the 400 error that it had to be unique... perhaps underscores should be noted to be avoided?
@royal rapids as noted -- underscores don't work went sent via the library. They do sort of work interactively but seem to get "converted"
@keen dirge from adam: "rule of thumb: never make your own key, OR send a key and then update based on what comes back from IO"
"the spirit of the advice is that IO always owns the key. so you can guess exactly the same, but if you guess even a little differently from IO, IO is "always right"
" so API clients should always either know the key by copy-paste from the web or by getting it from the API response because the API will always include the key it's thinking of in the response (to a feed create / update request)"
🤔 OK -- not sure I fully understand, but I'll just stick with dashes 😉
a- ha! A Feed Key MAY ONLY contain lower case ASCII letters, numbers, and the dash character (“-“).
I think the section labeled "KEY" clears it up for me. Thanks
@royal rapids I'm expanding the code now and I'm trying to modify your project here, and I have a question about how the AIO stuff is grouped. https://learn.adafruit.com/pyportal-iot-weather-station/circuitpython-code
when I read this code block, I'm not sure what is what- I have a group of feeds on AIO called "grey-printer" so that's an easy replacement for 'weatherstation', but from there I'm not sure what each line is doing with the variables # Set up Adafruit IO Feeds print('Getting Group data from Adafruit IO...') station_group = io.get_group('weatherstation') feed_list = station_group['feeds'] altitude_feed = feed_list[0] eco2_feed = feed_list[1] humidity_feed = feed_list[2] pressure_feed = feed_list[3] temperature_feed = feed_list[4] tvoc_feed = feed_list[5] uv_index_feed = feed_list[6] wind_speed_feed = feed_list[7]
I'm using a far simpler dataset and grabbing two temperature readings, interior-temperature and exterior-temperature, along with interior-humidity
When I try to modify it like this, I get an error on the line starting with "panel" that it can't assign to an expression # Set up Adafruit IO Feeds print('Getting Group data from Adafruit IO...') station_group = io.get_group('grey-printer') feed_list = station_group['feeds'] panel-temperature_feed = feed_list[0] interior-humidity_feed = feed_list[1] interior-temperature_feed = feed_list[2]
You might want to look at this regarding groups. I had a Groups related question a while back. https://github.com/adafruit/Adafruit_IO_Python/issues/104
I am trying to format the AIO io.receive_time() to a string, what's the best way to do that?
It looks like it's formatted like this struct_time(tm_year=2019, tm_mon=10, tm_mday=5, tm_hour=17, tm_min=51, tm_sec=29, tm_wday=6, tm_yday=278, tm_isdst=1)
Is there any detailed write-up on what one can do with the Map block in IO. I looked at a couple of the projects on the site but I am looking for what it is capable of regarding non-GPS derived plotting.
time.strftime is what you're looking for if you are using normal Python not CircuitPython
Thanks @abstract mica but I'm using CP. I'm moving this project to straight Python on a Pi- I already have a Pi on the project and CP just a little too new
@south gust If you're not using a GPS module, where are you pulling the data from?
@sacred depot You'd want to set time_struct=io.receive_time(), then parse it out like: year = time_struct.tm_year...
Then, you can print it out in whatever format you'd like: print("It is currently {0}:{1}:{2} on {3}/{4}/{5}".format(hour, minute, second, month, day year)
Thank you brent, I changed up my project again and won't be using Circuit Python and will just be using regular old Python on a Pi now.
Not even sure if this is doable with the map block but I have a lightning sensor that can tell distance to storm front which seems to be AS3935 standard. With distance could treat that as radius from zero point which would be sensor location and use radius to draw circle at that radius. Just an abstract question at this point because I can't really locate any detailed info on map block capabilities beyond the pair of GPS oriented tutorials.
@south gust if your microcontroller can do the calculations to derive lat/lon/elevation, sending the values to display on the map block would be a matter of manipulating the io.send() function call to include coordinates.
I don't think the detector works that way. I could be wrong but way I'm reading how sensor works it just tells how far away the lightning detection is. No , E, S, or W. Imagine it more like if you had a draftsmans compass to scribe a circle. Center of circle would always be at location of sensor and Pi. Sensor says lightning was 10km away so using the compass reference, programmatically you draw a 10km radius circle around sensor location.
HELLO i have some problem about adafruit io and ifttt linkage. does anyone help me?
@sacred depot Hi - what's the issue you're having?
i want to have a gmail alert via ifttt. but every alarm trigger in the ifttt applet shows the "applet failed"
what does it means
@sacred depot Have you checked out this applet setup page (https://learn.adafruit.com/gmailbox/ifttt-setup)?
i set up a applet like this but a service is about "if adafruit feed is x, then google mail sent to mine"
but the activities shows me all the trigger is "applet failed"
@sacred depot from IFTTT: "As of March 2019, Google is implementing changes to their API ecosystem that will impact the Gmail service on IFTTT."
Could you try using the Zapier setup instead of IFTTT? https://learn.adafruit.com/gmailbox/zapier-setup
and let me know if it works?
sorry, is that means gmail is out of service in ifttt now? because their gmail upgrade
Awsome, thanks @sacred depot . I'm going to deprecate the gmail steps on the guide for IFTTT if its no longer working
Switch to Zapier
I'm trying to post some simple measurements to Adafruit IO using Python on a Raspberry Pi. Here's what I have so far, and the only thing missing in this snip is the includes and my username/API key. I don't need to create any feeds, they are already created, I just need to push sensor readings to them. ```# Import Adafruit IO REST client.
from Adafruit_IO import Client, Feed
Create an instance of the REST client.
aio = Client(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_sht31d.SHT31D(i2c)
Return CPU temperature as a character string
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return(res.replace("temp=","").replace("'C\n",""))
#Do the actual work
while True:
# Get the CPU temp
cputempgrey = float(getCPUtemperature())
print(cputempgrey)
now = datetime.strftime(datetime.now(), "%Y-%m-%dT%H:%M:%S%Z")
etgrey = ('%.2f'%sensor.temperature)
print('%.2f'%sensor.temperature)
ehgrey = ('%.2f'%sensor.relative_humidity)
print('%.2f'%sensor.relative_humidity)
#Dummy values for now
atgrey = 22
ahgrey = 50
aio.send_data('enclosurehumiditygrey', etgrey)
aio.send_data('enclosuretemperaturegrey', ehgrey)
aio.send_data('ambienthumiditygrey', ahgrey)
aio.send_data('ambienttemperaturegrey', atgrey)
aio.send_data('cputemperaturegrey', cputempgrey)
time.sleep(1)```
I'm getting a 404 error when the script tries to post to AIO.
Looks like I was looking at an old API guide or mixing REST and HTTP. Here's a working example: ```# Import Adafruit IO REST client.
from Adafruit_IO import Client, Feed, RequestError
Create an instance of the REST client.
aio = Client(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_sht31d.SHT31D(i2c)
enclosurehumiditygrey = aio.feeds('greyprinter.enclosurehumiditygrey')
enclosuretemperaturegrey = aio.feeds('greyprinter.enclosuretemperaturegrey')
ambienthumiditygrey = aio.feeds('greyprinter.ambienthumiditygrey')
ambienttemperaturegrey = aio.feeds('greyprinter.ambienttemperaturegrey')
cputemperaturegrey = aio.feeds('greyprinter.cputemperaturegrey')
Return CPU temperature as a character string
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return(res.replace("temp=","").replace("'C\n",""))
#Do the actual work
while True:
# Get the CPU temp
cputempgrey = float(getCPUtemperature())
print(cputempgrey)
now = datetime.strftime(datetime.now(), "%Y-%m-%dT%H:%M:%S%Z")
etgrey = ('%.2f'%sensor.temperature)
print('%.2f'%sensor.temperature)
ehgrey = ('%.2f'%sensor.relative_humidity)
print('%.2f'%sensor.relative_humidity)
#Dummy values for now
atgrey = 22
ahgrey = 50
aio.send_data(enclosurehumiditygrey.key, ehgrey)
aio.send_data(enclosuretemperaturegrey.key, etgrey)
aio.send_data(ambienthumiditygrey.key, ahgrey)
aio.send_data(ambienttemperaturegrey.key, atgrey)
aio.send_data(cputemperaturegrey.key, cputempgrey)
time.sleep(5)```
As a note to my question above, when you see strike data on weather maps that show location data as a graphic overlay indicating location they are generally getting data from multiple sensors to triangulate. Or are subscribed to a commercial lightning detection network which is doing the same thing and selling the coordinate data.
hey brentru, the gmail function is still okay.
It is! Thank you! I actually have them posting publicly here... but I am actively working on both machines so they keep getting interrupted by reboots and other changes. https://io.adafruit.com/jdoscher/dashboards/factory
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
I have some ideas I'll be logging as feature requests, like a mobile view simulator/dedicated view, and spacer/divider objects for the dashboards
I really do love Adafruit IO... thank you for all the hard work you're putting into it!
No problem, keep requesting features and we'll add them as time goes on (https://forums.adafruit.com/viewtopic.php?f=56&t=139746)
Woah, lots of gauge+icon elements!
I'd love to get it all smaller somehow, I'm trying to get a single page view that shows how the printers are doing in terms of staying within temperature boundaries
Ideas like a thermometer view were the radial is too big, and you just want to know if a temp is under, over, or within limits
I haven't done much research yet but the ability to embed AIO stuff into pages so I can post blog entries with live updates from AIO, and click through to the main page, etc.
I'll spend some time later this week and post all of them to the requested features though
@royal rapids yes it is. zapier not suitable for me as it just support send me a email when data is match, but i need greater than or smaller than function
Cool! Ok, thanks @sacred depot for the feedback , it helps me keep track of what's workin and whats not.
@royal rapidsu thanks too
can someone help me how to send data from arduino uno to esp8266-12 nodemcu. i just locate all the mqtt path to adafruit io, its work. but the data shows all 0 every data arrive😫
i think its just the problem in the arduino ide
@royal rapids is there a trick that would let me add more width to the Adafruit IO dashboard? I'm trying to get 5 gauges side by side, and there's room on my screen- but widening my web browser on a high res display makes it go kind of crazy.