Sparky - WordPress meet Spark Core


#1

Sparky is a WordPress plugin that allows you to create shortcodes based on your Spark Core variables. It works like so:

  • Add your access token
  • Add a new spark/shortcode - your cores should be listed

Once saved you should see a live reading from the core on the right hand side of the screen (providing the core is online and the variable name is correct).

  • Copy the required shortcodes ([sparky id="#"] or [sparkystatus id="#"]) from the listing screen and add the shortcodes to a post, page or text widget.

This is an early release just for you folks so please get testing. I am already considering a slight rewrite to better support the Spark Core Cloud API and have plans for logging tools and cache clearing.

Once it is a little more refined I will post it to WordPress.org. In the meantime you can grab it from GitHub:

Enjoy!


#2

Good stuff! This could make it easy to build your own sort of sensor site quickly!


#3

Awesome! I’ve never played around with WordPress much, but this makes me very curious :slight_smile: Thanks for sharing @scottsweb!


#4

this is awesome!
i am a huge fan of wordpress. my mind is going to spin on some cool ways to integrate this…

i think someone at wordpress needs to know that they are now IoT enabled!


#5

This is Awesome!, thank for sharing @scottsweb.


#6

Good. :slight_smile: I have also basic plugin and widget for functions.


#7

Thanks everyone. I hope you find it useful for your projects.

@Yasin your widget looks very interesting. I have been thinking about the best way to trigger functions on the core from WordPress. I am thinking it might be good to tie it into the WP Cron functionality but am not sure how useful that will be.

WordPress has a great hook system which would be interesting to use with that side of the Spark Cloud API. For example when a new comment is added an action could be fired on the Spark Core.

Lots to think about!


#8

I m curious to use this plugin for website, but I can’t find it on WordPress. The reason I m curious to use it, is because I working on a project with teammates using proton in particle. How can I access to it? @scottsweb


#9

This thread is five years old.

But there is a link to the OP’s repository

And also a link to another thread with a similar intent.


#10

I tried the another thread but it doesn’t exist anymore according to the web browser.


#11

Yup, that thread is also from 2014 - I guess there wasn’t enough interest for this to evolve into something, but maybe the OPs of these threads from back then is still active on this forum - they were last seen round in 2017 tho’

Ping @scottsweb & @Yasin


#12

OPs? But thank you I m gonna keep trying to see, cause I really to find a way to connect Particle with WordPress. Thank you for the help.


#13

Original Posters or Original Post (depending on context).


#14

Oh


#15

Does particle have a SQL library?


#16

I have tinkered with sending data from Photon to MS SQL from time to time. I never send from the Photon directly to the SQL server because there’s not really enough memory to handle the full SQL connection (not to mention you should be using TLS for the connection as well). So, my solution is to send data via http into a webserver with a custom API. You can easily write an API using some readily available tutorials and tools. I use C# and .Net for development and I have many MS servers available to me so I found this guide helpful:

Please note, I have full access to the network so I can segregate the data onto a VLAN or other security method. You should use webhooks if your data will be traversing the internet at large. I also have considered using a webhook to Azure, then using an Azure function to write back into my internal database (via VPN to Azure). Your capabilities and available resources will drive this adventure. But, no SQL library on Particle that I know of.

Here’s another example.


Help novice with photon