Display Image that updates automatically on Raspberry Pi - raspberry-pi

I'm new to Raspberry Pi. I have a small screen attached. I'm looking for a command that I can use to display an image. I got it working using fbi (https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/displaying-images). But here's the trick....I want to be able to have another application change the image that it is displaying. So for example, if I login and run this command:
sudo fbi -T 2 -d /dev/fb1 -noverbose -a theImage.jpg
Then, I have another application that is running as a service change theImage.jpg to be something else....how can I have fbi recognize that the image changed and refresh to the current image. Ideally it would be close to real-time. Any ideas? Am I going to have to write an app to do this instead of using something like fbi?

You could use chromium to display a webpage, and have the image in HTML. Then you could use a javascript loop that would manipulate the image as you see fit using the set interval function. This would involved you installing apache2. You can even tell chromium to open in full-screen (kiosk mode) on boot, so your display is always running.
Here is my preferred method:
sudo leafpad /etc/xdg/lxsession/LXDE-pi/autostart
Add line: #chromium-browser --kiosk --incognito “localhost/index.html”
And your javascript program runs in index.html
I use this for more advanced display purposes but it should work for you.

Related

Flutter Firebase DebugView not sending events

Initially the person before me set up a screen observer so that whenever the page changes, setCurrentScreen is triggered to send a event and log the screen. Because we use a bunch of open containers to animate page opening, the screen observer doesnt get triggered. So I went through the app and added some setCurrentScreen for those that the screenObserver missed, and while there I also added some logEvents to see if people are using specific parts of the app.
The way I set enabled debug view was in xcode, going to Product -> Scheme -> Edit Scheme and adding -FIRAnalyticsDebugEnabled and -FIRDebugEnabled Edit scheme
After ticking both of the above (or just one or the other), only these events are being triggered then the app stops sending events. Completely. What am I missing? output
I cannot find another issue about this. I am using the same package name in the app and firebase, otherwise I would have no output. All other issues are talking about no output at all. I have tried to do this on simulator and on actual iPhone and they both yield the same result. I have also set up a android emulator and have an actual phone. Tried it on both and same result. The above screenshot is from iPhone as I am on Mac and more comfortable working on a iPhone.
i have set IS_ANALYTICS_ENABLED to true in the .plist file and this did not work

Unity WebGL Mobile browser workaround and keyboard input fix?

Hey everyone so I read that unity doesn't really support mobile browsers for WebGL games. im using 2020.1.4.And sure enough, the game gets a bit distorted by not being scaled properly. it's like the camera is bigger so it shows on the screen that blue color. I tried some things, setting width and height to auto or removing config.devicePixelRatio = 1; as suggested by a friend but nope! still looks horrible! And if that wasn't enough the keyboard doesn't show up when clicking on form fields. i tried this one
https://github.com/eforerog/keyboardMobileWebGLUnity
which displayed an error when pressed on and this one
https://github.com/dantasulisses/WebMobileInputFix which just didn't even compile!
Any ideas, please?
I did my research and tried every plugin I could find. I used Unity 2020.3.28f1 and tested both on Android-phone and iPhone.Here is my report.
These plugins don't work:
https://unitylist.com/p/f58/Unity-webgl-inputfield
https://github.com/eforerog/keyboardMobileWebGLUnity
https://github.com/dantasulisses/WebMobileInputFix
This plugin works, but you should use different settings for IOS and Android on same input field game object. If you use "prompt", it works for IOS only, and "overlay" works for Android only. Look for documentation in page:
https://github.com/unity3d-jp/WebGLNativeInputField
And this plugin works best at the moment. Yes, it is a bit ugly though, but it works.
https://github.com/kou-yeung/WebGLInput
And there is a fix for Unity 2021 for it:
https://github.com/kou-yeung/WebGLInput/releases/tag/1.0
There's a keyboard that overlays, when using it you just need to tap the notification to access it and then click the "back" button to hide it https://play.google.com/store/apps/details?id=com.fishstix.gameboard
I made this project that simply recreates a keyboard using buttons in unity.
I implemented it in a WebGL build successfully.
https://github.com/thetimeste/WebGL-Build-Keyboard-Unity.git
I would recommend using the native js window.prompt() fields as of writing. They have great cross-platform support, allow for extra features like special characters, emojis, copy and paste etc. and are pretty easy to set up. Once (or honestly if ever) Unity adds their own reliable implementation you can easily remove this lightweight implementation.
Create a .jslib file that has a function opening a window.prompt(description, currentText)
Return the result at the end of that function back to a unity object with a recipient script
Make a derivation from Unity's event system overwriting the OnApplicationFocus(bool focus) function (leaving it empty), to fix a sneaky Chrome Android bug.
That's it. The result should look something like in this demo: https://pop.demo.neoludic.games
If you want to save some development time on a feature that really should just be native in Unity, you can also check out my plugin based on the method above. https://neoludic-games.itch.io/pop-input
I also need to enable mobile virtual keyboard for running webgl on mobile device.
I've tried the code from your mentioned url. It gives you some idea on how to do
it, but the code are totally buggy and unusable. Now I am trying to implement it
by myself.

Xvfb GTK3 transparency

I have a GTK a application which creates "transparent" windows using the following snippet of code
GdkScreen* screen = gtk_window_get_screen(window);
GdkVisual* screen_visual = gdk_screen_get_rgba_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(window), screen_visual);
gtk_widget_set_app_paintable(GTK_WIDGET(window), true);
This works just fine when running on a "regular" display and the windows are correctly layered on top of each other, however when running it in an Xvfb screen, using something like this Xvfb :0 -nocursor -screen 0 1920x1080x24+32 +extension RANDR +extension XVideo +extension RENDER, GTK completely disables the transparancy and the windows end up being opaque. (resuting in only the top layer window being visible)
Is there a way to allow GTK to create this transparancy inside the headless screen?
For anyone looking into the same issue, I was missing an x composite manager for Xvfb (such as xcompmgr). When running this for the Xvfb display it works as expected.

TYPO3 Backend displaying image too large

In my TYPO3 7.6.4 when I set up a text & media content element and add a picture it is displayed too large, like its shown in the screenshot
Is there a possibility to fix that? and how?
To make the image procession in TYPO3 work, make sure that
you have installed either GraphicsMagick or Imagemagick on your system
you put the correct path to the binary in [GFX][im_path]. E.g. /usr/local/bin/
you put gmor im6 into [GFX][im_version_5] depending on what you are using.
you set [GFX][image_processing] to 1.
You can change these values in the install tool under "all configuration" in the GFX section.
You should also clear your processed images in the install tool ("Clean up" section) to make sure they are generated with an updated configuration:
Your image processing tests should look like this:
Maybe your PHP is configured to not execute binarys on the server, so ImageMagick can't be launched.
Check "System evironment" in the install tool for some errors or check if the php setting disable_functions containts exec.
if IM/GM is working well (install_tools test are ok) and the thumbnails in file list module are computed correct its the preview in the content elements.
Have a look at the preview definition of your content elements: is the HTML and CSS correct to show the image inside the preview area of that contentelement?

Ipython 0.13.1: Ipython.display.Image doesn't load local png files in notebook

I can't figure out why I can't load a local png file into my ipython notebook. I have in a cell:
from IPython.display import Image
i = Image('../heavy_vortex_3/frames/x_snap_n0000000.png')
i
and instead of seeing the image, i get a little "broken picture" image. Remote pngs work fine, for example:
Image(url='http://upload.wikimedia.org/wikipedia/en/b/bf/Firefox.png')
happily renders that little fox guy. Is there something I'm doing wrong?
Image assume by default you are passing an url and will display an img tag with the href attribute set to the value you passed. You are basically trying to access
http://localhost:8888/../heavy_vortex_3/frames/x_snap_n0000000.png
And probably unless you use some kind of middleware, your asking that to the ipython webserver that have no clue of what you wish.
I think what you want is to display an image with respect to the current working directory of the kernel. So you want to use the filename ( If I remember correctly) kwarg.:
Image(filename='../heavy_vortex_3/frames/x_snap_n0000000.png')
Which will actually read the file, and send it on the wire.