Yes, it's thread-safe. sys.exc_info() was introduced to deal with thread-safety problems in the previous API. Its output is specific t
I recently bught arduino yun shield from Geetech, and discovered there is not straight way even for a linux user , as on Yun we are dealing with OpenWRT lite version of Linux so the packages has to be light as well, as Yun shield has just 5MB of space.
this post is just some links that will be useful, rest I will post in the next upcoming blog post:
I was first thinking to recursively call the ajax function to pull IP and then geo data based on IP. But I later realize since both Json is of different structure. Doing that would be too great of a thing. So there you go nice and neat (y)
I was displaying the temperature and humidity from outdoor and indoor on google gauge(see here). However the only disadvantage of it is every time you will get to see the latest values and you have no straight away way to see the old values, so I was thinking lets spend this weekend with Google Line Chart while some of my fellow office colleagues are away walking for a noble cause.
on right you are looking at the mobile view of the graph I implemented with lots of digging, researching and reading google Chart Docs . The docs helped me a lot while I was trying hit and try to see what happens with attributes and customisation settings shown on the page.
Have a look at the graph displaying data in realtime from the sensors connected to Arduino Mega running web server using Ethernet shield. And since its realtime and data is updated every minute based on setInterval function there is no use of sql or any dbms. I believe we only need to punch data into database if we have to do some research or analysis further based on the data. Or if you want to learn about databases .
Getting the IP address over internet is no difficult.
The above code gives us the client IP, however if you want to get local IP address , you can use WebRTC JS API and the ICE protocol (STUN for public IP).
More info here.
thanks for your time, I hope this post helped you.
Much of it is same how to turn on LED on using a push button tutorials you might have come across on the internet, however I have used millis function to turn off the solenoid after 10 seconds. You can choose for how much time you want.
What you need
Once you have all hooked up as shown in above fritzing,
Upload the below code to your UNO. I have set 10 seconds represented by interval variable which in code is showing set to 10000 milli seconds.
Have fun, Feel free to contach in case you need any help.
While working on my weekend arduino automatic plant pot watering project, I decided to put a button on web page to turn on and off the solenoid. The button on a web page to turn on solenoid works the same way as you might have read turning on LED. Except in case of solenoid I am keeping its state to off by default which means in the loop function when the code iterates the second time after the link was clicked in browser that turns itself on , will get set to off imidietly. So here comes the use of millis function.
Lets examine the above code how it is done.
First I capture the URL "/?waterPlant1" and check if it is greater than 0. That would mean it found the word we are looking for in the header recieved from the client browser.
Next I turn on the solenoid. However we want to keep it on for 10 seconds to so sufficient amout of water gets poured into pot(depending how big the pot is.) so instead of resetting the readString to empty string. I wait for 10 seconds, as soon as 10 seonds passes. it is reset to empty string and default of solenoid turns it off.
I hope it was useful for you. Let me know in case you need any help in the comments below.
After lots of hits and try, I have overcome one challenge to pull data from cloud service like thingspeak.com or sparkfun.com. On both these website a user can store sensor data free of cost and retrieve it to display visualization. I choose to display using Google Gauge.
Displaying on google gauge means I need the latest value only unlike in case of line chart I would need some n time stamp amount of data.
First example is to display data from thinkgspeak.com, whcich you can learn from if you create Google Gauge plugin on the website, retrieving data from things speak and displaing is trivially easy , as they straight away provide last.json file that has the latest value of the channel that is storing the value of sensor data.
This almost drove me nuts into breaking apart after trying so many times. And finally I got it working.
Lot of tutorials on the internet about uploading data to mysql server from arduino exists, but no one is talking about making sure how to make mysql server open to remote connection.
Follow the simple steps before you try your sketch to upload to arduino. I have used Arduino Mega and Ethernet Shield mounted ontop of it, shown in above picture.
then you grant privileges as shown below.
Important Note: the ip address shown in above mysql queries 192.168.156 is the ip address of my ethernet client/server establishing connection with database on mysql remote server.
Thats it. This will surely work. Now to test it Have a look at the below Arduino Sketch I used for testing.
A while back when I was planning to do some experimental projects with Arduino UNO, I bought 20x4 LCD HD44780. This LCD is big compared to Arduino UNO which fits in palm. My greed tied to buying this LCD was it has 4 rows which means I can display more data in a single instant. But today now when I was wiring it up, its size and lot of wires required to be connected in order for it to work took my too much time and effort. To my understand someone would first tie up his project using jumper wires and bread board before finalising it. So here it is what I have.
Buy Required material
awakened by thoughts,