Giter VIP home page Giter VIP logo

Comments (9)

ShaneSutro avatar ShaneSutro commented on July 20, 2024

Good morning! Hope you are enjoying the snow!

To answer your question, yes this is already supported with this wrapper! All you need is your Installable's API key and API Secret and for it to be installed on that particular board via Vestaboard's portal.

I'm assuming you already know this, so posting for others who may not know: You can display a particular board by passing in the board ID as a URL param like this:
https://simulator.vestaboard.com/?disableAnimation=0&boardId=put-your-board-ID-here
(These also currently work in an <iframe> if you'd like to embed in a website)

Once you have that set up, it's a matter of creating an instance of Installable() and pass that into a new Board(). Let me know if it gives you any issues!

Shane

from vestaboard.

guenter-ms avatar guenter-ms commented on July 20, 2024

from vestaboard.

ShaneSutro avatar ShaneSutro commented on July 20, 2024

Ah, I see what you're saying!
So you'll need to create a new installable on the Vestaboard portal first to get your keys!

(Edit: I forgot to answer the first part of your question - you do not need to buy a board first. My own boards haven't even arrived yet - I'm doing all my development in the test portal)

Here's what you do:

  • Go to https://web.vestaboard.com and sign in.
  • On the left, choose Developers
  • Click the Create new installable button and give it a name
  • Click the Create your first API Credential button. This is where you associate the installable with a particular board (physical or electronic/simulated)
  • Save/store your API Key and API Secret in a safe place

That's it from Vestaboard's side of things.
Now in your code, create an instance of Installable:

import vestaboard

installable = vestaboard.Installable('your api key', 'your api secret') # This will get and store your Subscriber ID, which you will also need

vboard = vestaboard.Board(installable)

#Done! Now you can call methods on vboard to post to your simulator:
vboard.post('Seize the day!')

Let me know how it goes or if you need more help!

Shane

from vestaboard.

guenter-ms avatar guenter-ms commented on July 20, 2024

from vestaboard.

ShaneSutro avatar ShaneSutro commented on July 20, 2024

Totally understand what you're saying! I'll certainly consider adding that documentation, although that does have more to do with Vestaboard's portal and less to do with this software.
Still, any tips and tricks are always useful!

The code is not JavaScript, it's Python - you should be able to copy/paste just that script above and run it (obviously you'll need to swap out the arguments with your own actual API Key and API Secret to get it to work.

Not sure why it's not being found with pip, but I suspect it has to do with how you're calling pip. This package is only available for Python >= 3.6. I believe that pip defaults to the Python 2 version of the installer. Since Python 2.x is not supported, that may be why it's not finding it. Try running it with pip3 instead like this:
pip3 install --upgrade vestaboard
This should work on Mac or Raspi, but I will check on my own raspi and see if there's a problem with that.

I haven't done anything with nodered, but it sounds interesting! I'll add that as a feature request and look into that! Thanks for the suggestion. Do let me know if installing with pip3 works or if it's still erroring and I will open an issue.

from vestaboard.

guenter-ms avatar guenter-ms commented on July 20, 2024

from vestaboard.

ShaneSutro avatar ShaneSutro commented on July 20, 2024

Gotcha, we're getting closer!
I just verified on my own Raspberry Pi, and it's definitely to do with the whole Python 2 vs Python 3 thing.

That error you got is regarding that string format. Python's so-called "f-strings" are only supported in Python 3, and it looks like you're running it with Python 2. Just like you needed to specify pip3 instead of pip, you also need to call the script with python3 not python.
Make sure when you're running your file you specify that it should be run with Python 3 as follows:

pi@raspberrypi:~ $ python3 importapi.py

Thank you for bringing these to my attention! I will update the docs accordingly.

Just as a side note, if you are running these commands from within a virtual environment, you do not need to specify the '3' after either of those commands (you'd use pip and python, not pip3 or python3).
Whenever possible, create a new virtual environment and store dependencies there - helps with cross-bleeding of packages. Python's docs have a good tutorial on how to use virtual environments that you can check out, or there are lots of good tutorials on YouTube!

from vestaboard.

guenter-ms avatar guenter-ms commented on July 20, 2024

from vestaboard.

ShaneSutro avatar ShaneSutro commented on July 20, 2024

Glad to hear! I'm going to go ahead and close this. If you need anything else, feel free to shoot me an email!

from vestaboard.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.