User avatar
tonyhansen
Posts: 13
Joined: Sat Jan 03, 2015 6:20 am

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Tue Oct 04, 2016 6:53 pm

ETexan wrote:
tonyhansen wrote:
  • The grabbers to reorder the list don't seem to work on an iPad.
Surely that must be an issue with the iPad browser's html implementation and nothing to do with screenly?
Not necessarily. It might be something in the javascript, CSS or HTML used by screenly that is not fully cross-browser compatible. I wouldn't know without digging deep into the bowels of the code.

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Tue Oct 04, 2016 9:51 pm

tonyhansen wrote:
ETexan wrote:
tonyhansen wrote:
  • The grabbers to reorder the list don't seem to work on an iPad.
Surely that must be an issue with the iPad browser's html implementation and nothing to do with screenly?
Not necessarily. It might be something in the javascript, CSS or HTML used by screenly that is not fully cross-browser compatible. I wouldn't know without digging deep into the bowels of the code.
To my knowledge, we're simply using Bootstrap (which should have full cross-browser support). If that isn't the case, please create an issue on Github. Perhaps it has been fixed in a later Bootstrap version.
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

ETexan
Posts: 11
Joined: Sun Jan 11, 2015 8:42 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Thu Oct 06, 2016 9:19 pm

Hey all, I've been working with the screenly API over the past weeks and thought I'd post some hints that might help out some other people.

I've been using Python and found that the requests library makes the GET and POST process of interacting with the API very simple.

It can be downloaded from here:

http://docs.python-requests.org/en/master/

I'm on Windows, so I used pip-Win to help me get set up to install the requests library

https://sites.google.com/site/pydatalog ... or-windows

Going through the documented API calls using these tools:

Retrieve information about all assets:

Code: Select all

import requests
url = 'http://192.168.0.100:8080/api/assets'
r = requests.get(url)
"""
	returns a list 'r' of data objects that describe each screenly assets
	r.json() returns a list of dictionary objects describing each screenly asset
	r.json()[0]['asset_id'] returns the asset_id value of the first screenly asset in the list
"""
Retrieve information about a specific asset by asset_id value:

Code: Select all

import requests

asset_value = '2d8331612b6c4c0e8075417a2d2e5db5'
url = 'http://192.168.0.100:8080/api/assets/' + asset_value
r = requests.get(url)

"""
	returns a single data object describing the specific asset
	r.json() returns a single dictionary object describing that asset
	r.json()['asset_id'] returns the asset_id value of the screenly asset

	if there is no asset with the supplied asset_id, then r.json() returns []
"""
Add a new screenly webpage asset:

The required values for adding a new webpage asset are name, mimetype, uri, and duration

Code: Select all

import requests
url = 'http://192.168.0.100:8080/api/assets'
dataDict = {'mimetype': 'webpage', 'duration': 10, 'name': 'Webpage 1', 'uri': 'http://www.google.com'}
r = requests.post(url, data=dataDict)

Add a new uploaded screenly image asset:

The minimum required values for adding a new image asset are name, mimetype, and duration.
The path to the file to be uploaded must also be supplied as a parameter to requests

Code: Select all

import requests
url = 'http://192.168.0.100:8080/api/assets'
dataDict = {'mimetype': 'image', 'duration': 10, 'name': 'Image 1'}
imgFile = {'file_upload': open('Z:/screenly/th.jpg', 'rb')}
#Note the use of forward slashes in this hard-coded example
#In practice, it would be better to use the tools found in the os module
r = requests.post(url, data=dataDict, files=imgFile)
Delete a screenly asset:

Code: Select all

import requests
asset_value = '2d8331612b6c4c0e8075417a2d2e5db5'
url = 'http://192.168.0.100:8080/api/assets/' + asset_value
r = requests.delete(url)
Change order of screenly assets:

Code: Select all

import requests
asset_value1 = '00784525f83c4fc391c2f52a2f54e5f2'
asset_value2 = 'd14b76a2ad83442597008f7a39e741a2'
url = 'http://192.168.0.100:8080/api/assets/order'
dataDict = {'ids': asset_value1 + ',' + asset_value2}
r = requests.post(url, data = dataDict)
Change screenly asset attribute:

Code: Select all

import requests
asset_value = 'd14b76a2ad83442597008f7a39e741a2'
url = 'http://192.168.0.100:8080/api/assets/' + asset_value

#Get the current settings
r = requests.get(url)

#Put the results into a dictionary object
dataDict = r.json()

#modify the value in the dictionary
# is_enabled = 0 makes inactive
# is_enabled = 1 makes active

dataDict['is_enabled'] = 0

#write the modified value back
r = requests.post(url, data = dataDict)

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Oct 07, 2016 8:43 am

Nice work, ETexan.
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

ETexan
Posts: 11
Joined: Sun Jan 11, 2015 8:42 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Oct 07, 2016 4:42 pm

vpetersson wrote:Nice work, ETexan.
Thanks!

User avatar
tonyhansen
Posts: 13
Joined: Sat Jan 03, 2015 6:20 am

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sun Oct 09, 2016 9:54 pm

[Edit: adding a bit more info here]
okay, I was successful in creating a pull request. I hope people find this mod useful.

I just filed the issue "add support for HTTP Basic Authentication #493", but instead of just being a complaint, it includes a complete fix within it. (The pull request went in as issue #495.) It's very straight forward, using bottle.py's auth_basic() decorator. I chose to do it using a new auth section within the server.conf configuration file:

Code: Select all

[auth]
user=yourid
password=your pass phrase

If the values for user and password are empty, no password will be required.

Each of the @route()s that need to be protected get a new decorator:

Code: Select all

@auth_basic(check)
check() is a function in server.py:

Code: Select all

def check(user, passwd):
    return settings.check_user(user, passwd)
settings.py gets a new function:

Code: Select all

    def check_user(self,user,pswd):
        try:
            au = self['user']
            pw = self['password']
            logging.info("check_user(" + user + "," + pswd + "), looking for (" + au + "," + pw + ")")
            if au == "" and pw == "":
                logging.info("check_user() requires no password")
                return True
            ret = au == user and pw == pswd
            logging.info("check_user() is returning %s" % ret)
            return ret
        except :
            e = sys.exc_info()[0]
            logging.info("check_user could not find a user " + str(e))
            return True
and the DEFAULTS configuration gets a new section as well:

Code: Select all

    'auth': {
        'user': '',
        'password': ''
    }

bjornhallberg
Posts: 8
Joined: Sun May 25, 2014 3:46 am

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Thu Oct 13, 2016 7:14 am

Just discovered Screenly OSE / Pro and now have a quick question:

How does the Pro version fetch its data from the server? By timer or is it pushed on demand? Is it possible to run from a RPi that has no public IP / is behind a corporate firewall? Similar to how TeamViewer works?

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Thu Oct 13, 2016 7:52 am

bjornhallberg wrote:Just discovered Screenly OSE / Pro and now have a quick question:

How does the Pro version fetch its data from the server? By timer or is it pushed on demand? Is it possible to run from a RPi that has no public IP / is behind a corporate firewall? Similar to how TeamViewer works?
Hi Bjorn,

You can find the difference between Pro and OSE:
https://www.screenly.io/pricing/

Since those questions mostly relates to Pro, here are the answers for that:

> How does the Pro version fetch its data from the server?

Just using a regular HTTPS fetch.

> By timer or is it pushed on demand?

Both. The primary method is push (using a websocket), but there's also polling in the case this fails.

> Is it possible to run from a RPi that has no public IP / is behind a corporate firewall?

Yes, that's the most common (and recommended solution). Providing the Raspberry Pi with a public IP is not recommended.
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

aamato
Posts: 2
Joined: Tue Feb 17, 2015 8:26 pm
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Oct 28, 2016 12:01 am

Is it possible to upload automatically +400 videos? I don't want to do that manually.... thanks

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Oct 28, 2016 9:37 am

aamato wrote:Is it possible to upload automatically +400 videos? I don't want to do that manually.... thanks
In theory, yes. It would however require that you write a tool that either uses the API (https://github.com/wireload/screenly-os ... ocs/api.md) or directly on the device (copy to ~/screenly_assets and then insert them into the database).
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

teroenza
Posts: 15
Joined: Sat Aug 08, 2015 4:41 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Wed Nov 02, 2016 11:16 pm

I installed Raspbian lite, then used the curl command to install Screenly after following the raspi-config setup instructions. It fails near the end of the installation, at the database migration step. Near the end of the error message it says it can't read the database file.

I tried running
python /home/pi/screenly/bin/migrate.py


and it complains "sqlite3.OperationalError: unable to read database file.

I tried the Screenly image itself, but nothing ever happens when booted. I'm using an original Rasperry pi (1st model).

I'm not sure how to export the terminal to a textfile if more information is needed.

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Thu Nov 03, 2016 11:06 am

teroenza wrote:I installed Raspbian lite, then used the curl command to install Screenly after following the raspi-config setup instructions. It fails near the end of the installation, at the database migration step. Near the end of the error message it says it can't read the database file.

I tried running
python /home/pi/screenly/bin/migrate.py


and it complains "sqlite3.OperationalError: unable to read database file.

I tried the Screenly image itself, but nothing ever happens when booted. I'm using an original Rasperry pi (1st model).

I'm not sure how to export the terminal to a textfile if more information is needed.
Most likely, this is the result form either a corrupt SD card or a failed flash.

I would suggest that you do the following:

* Get a new SD card
* Re-download the disk image
* Verify the download using the MD5 file
* Flash it out again
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

bettybrdfrd
Posts: 1
Joined: Fri Nov 04, 2016 2:42 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Nov 04, 2016 3:21 pm

Relative beginner, so please be gentle. And I've tried to find an answer in the forums unsuccessfully.
I downloaded the Screenly image, and produced an SD card. But on power-on, I get a moment of login screen, then the vieo, repeated endlessly.
Note - I don't have a wired connection, just wireless. And I can't configure the wireless as I need to log in.
I can't log in as the video keeps playing (even trying Ctrl-Alt-F1 or whatever the magic is, with my attached keyboard)
Various threads suggest connecting to Screenly to stop the video. But I can't connect as I need to configure the wireless dongle first.
Solution 1: Use wired. I can't unless I take the Pi into a different room (where the router is) and work on the floor. OK, last resort.
Solution 2: Download a Raspbian image, configure wireless and then add screenly separately. OK, but shame I can't use the preconfigured SD card image.
Solution 3: Any suggestions?

teroenza
Posts: 15
Joined: Sat Aug 08, 2015 4:41 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Nov 04, 2016 9:40 pm

I did what you suggested, and get the same issue. The power light comes on, but nothing else, no boot sequence or anything. The pi should be fine as I can boot raspbian on it.

Would it be an issue using an microSD to regularSD converter? The pi1 has a full-size SD slot, and all I had around were micro cards.

[EDIT] I put the microSD card in my Raspberry pi 2, and got the same result. Lights on, no boot.

bjornhallberg
Posts: 8
Joined: Sun May 25, 2014 3:46 am

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sun Nov 06, 2016 6:21 pm

vpetersson wrote:
bjornhallberg wrote:Just discovered Screenly OSE / Pro and now have a quick question:

How does the Pro version fetch its data from the server? By timer or is it pushed on demand? Is it possible to run from a RPi that has no public IP / is behind a corporate firewall? Similar to how TeamViewer works?
Hi Bjorn,

You can find the difference between Pro and OSE:
https://www.screenly.io/pricing/

Since those questions mostly relates to Pro, here are the answers for that:

> How does the Pro version fetch its data from the server?

Just using a regular HTTPS fetch.

> By timer or is it pushed on demand?

Both. The primary method is push (using a websocket), but there's also polling in the case this fails.

> Is it possible to run from a RPi that has no public IP / is behind a corporate firewall?

Yes, that's the most common (and recommended solution). Providing the Raspberry Pi with a public IP is not recommended.
Great, thanks! I've been running Screenly Pro (Free) for a while now. Administering the screen works through the firewall but I have an intermittent problem with the system becoming unreachable. Always around midnight so I suspect some sort of switch reboot or whatnot. Should I muck around with the system to set up a cron reboot (or network refresh) every night or is there some sort of built-in mechanism for this? Perhaps it is better to change to OSE and just Teamviewer in to the network to administer the screen?

BAHbKA
Posts: 2
Joined: Sun Nov 13, 2016 12:57 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sun Nov 13, 2016 1:02 pm

Hello,

is it possible to show content from a website which requires authentication?

karhyv
Posts: 7
Joined: Tue Mar 12, 2013 6:38 am

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Thu Nov 17, 2016 1:14 pm

I have a strange problem. Several weeks now (from late August), Google Docs presentation refuses to run in Screenly because of Javascript (which apparently is missing). Nothing has changed in the setup. HTML pages without Javascript run fine.

I have rebuilt the system - twice - from the ground up from the original 4G SD image but the error persists. What is going on?

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Thu Nov 17, 2016 3:49 pm

karhyv wrote:I have a strange problem. Several weeks now (from late August), Google Docs presentation refuses to run in Screenly because of Javascript (which apparently is missing). Nothing has changed in the setup. HTML pages without Javascript run fine.

I have rebuilt the system - twice - from the ground up from the original 4G SD image but the error persists. What is going on?

It could be a change upstream in Google Docs perhaps. Is anyone else able to reproduce this?
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

hans12345
Posts: 4
Joined: Wed Jan 27, 2016 1:36 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Nov 18, 2016 12:54 pm

Thanks for Screenly! I would like to change the default End date for new assets, e.g. from 1 week to 1 year. Is that possible, maybe by changing a Python file? Which file would that be?

karhyv
Posts: 7
Joined: Tue Mar 12, 2013 6:38 am

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Fri Nov 18, 2016 1:07 pm

vpetersson wrote:
karhyv wrote:I have a strange problem. Several weeks now (from late August), Google Docs presentation refuses to run in Screenly because of Javascript (which apparently is missing). Nothing has changed in the setup. HTML pages without Javascript run fine.

I have rebuilt the system - twice - from the ground up from the original 4G SD image but the error persists. What is going on?

It could be a change upstream in Google Docs perhaps. Is anyone else able to reproduce this?
Google Docs is certainly one suspect. I experimented with a test which basically just loads a Google Slides file instead of trying to display the slide show. I got an error message about "unsupported browser version". Uzbl getting old?

hans12345
Posts: 4
Joined: Wed Jan 27, 2016 1:36 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sat Nov 19, 2016 5:44 pm

While testing Screenly sometimes does not show a recently added asset. The asset is in the list, activated (ON) but does not show on screen. Only a reboot does. Is this a known bug or an error on my part? I am using a RPi 1b+ with a 8G SD with 5G available.

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sat Nov 19, 2016 7:33 pm

hans12345 wrote:While testing Screenly sometimes does not show a recently added asset. The asset is in the list, activated (ON) but does not show on screen. Only a reboot does. Is this a known bug or an error on my part? I am using a RPi 1b+ with a 8G SD with 5G available.
No this is not a known bug. Please do this:

* Try upgrading to the development branch

If that doesn't fix it, please open a Github issue with precise steps on how to reproduce the issue.
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

hans12345
Posts: 4
Joined: Wed Jan 27, 2016 1:36 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sat Nov 26, 2016 2:28 pm

Sorry about that: I could not reproduce the error, so I am very happy with Screenly now.

Also glad that Screenly is sturdy / resilient in the sense that it can startup OK without an ethernet connection and when that becomes available later the web interface is working without a restart. So that is good in a not so stable network environment!

Still open is my question a few entries back about changing the default end date of an asset.

BAHbKA
Posts: 2
Joined: Sun Nov 13, 2016 12:57 pm

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sat Dec 03, 2016 9:57 am

After updating screenly yesterday, my raspberry is no longer connecting via wifi. My WIFI settings: "/etc/wpa_supplicant/wpa_supplicant.conf":

Code: Select all

"/etc/wpa_supplicant/wpa_supplicant.conf":

# WLAN
network={
    ssid="BAHbKA"
    psk="99999999"

# WLAN Handy HotSpot
network={
    ssid="Wasabi"
    psk="99999999"
}	
I have 2 SD cards with different version of screenly both with same settings. The older version is always connecting without any problem while the updated version don't.

Can anyone help?

vpetersson
Posts: 391
Joined: Wed Jul 25, 2012 9:23 am
Contact: Website

Re: Screenly OSE -- Digital Signage for the Raspberry Pi

Sat Dec 03, 2016 2:47 pm

Yes, we should document this better, but please see this Github issue:
https://github.com/wireload/screenly-ose/issues/516
BAHbKA wrote:After updating screenly yesterday, my raspberry is no longer connecting via wifi. My WIFI settings: "/etc/wpa_supplicant/wpa_supplicant.conf":

Code: Select all

"/etc/wpa_supplicant/wpa_supplicant.conf":

# WLAN
network={
    ssid="BAHbKA"
    psk="99999999"

# WLAN Handy HotSpot
network={
    ssid="Wasabi"
    psk="99999999"
}	
I have 2 SD cards with different version of screenly both with same settings. The older version is always connecting without any problem while the updated version don't.

Can anyone help?
Creator of Screenly (Screenly.io), the leading digital signage solution for the Raspberry Pi.
Twitter: @vpetersson | vpetersson.com

Return to “Other projects”