segunda-feira, junho 29, 2020

Instalar Smart TV IPTv app na Samsung manual via Develop

https://siptv.eu/howto/sammy/

You can also use Sync server IP address 116.202.226.250 to use in developer mode.


Ir no menu e conectar na conta como "develop".

Após isso pressionar um aplicativo na lista até aparecer o menu lateral, conforme imagem...

Adicionar o IP e repetir o menu Atualizar Apps

O Smart IPTV deve aparecer...

Developer IP para SSIPTV  91.122.100.196

116.202.226.250 (Smart IPTV)
91 122 100  196 (SSIPTV)

94 23 97 11 (Set Iptv)





segunda-feira, junho 01, 2020

Install Firebird 1.5 on Debian stretch 9.8 architecture amd64

The most tricky paristo make your amd64 system install i386 packages in order to have Firebird running.


Let's start by running dpkg and add i386 as new architecture. Reference here

dpkg --add-architecture i386

change /etc/apt/sources.list
(exemple bellow)
deb [arch=amd64,i386] http://ftp.br.debian.org/debian/ stretch main
deb-src [arch=amd64,i386] http://ftp.br.debian.org/debian/ stretch main

deb [arch=amd64,i386] http://security.debian.org/debian-security stretch/updates main
deb-src [arch=amd64,i386] http://security.debian.org/debian-security stretch/updates main

# stretch-updates, previously known as 'volatile'
deb [arch=amd64,i386] http://ftp.br.debian.org/debian/ stretch-updates main
deb-src [arch=amd64,i386] http://ftp.br.debian.org/debian/ stretch-updates main


---
Install the required packages

apt install lib32ncurses5
apt install libstdc++5:i386

--

Check with ldd if the library are working fine...
ldd /opt/firebird/lib/libfbclient.so
        linux-gate.so.1 (0xf7746000)
        libstdc++.so.5 => /usr/lib/i386-linux-gnu/libstdc++.so.5 (0xf7606000)
        libncurses.so.5 => /lib32/libncurses.so.5 (0xf75e1000)
        libcrypt.so.1 => /lib/i386-linux-gnu/libcrypt.so.1 (0xf75af000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf755a000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73a2000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf739d000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7380000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7362000)
        libtinfo.so.5 => /lib32/libtinfo.so.5 (0xf733f000)
        /lib/ld-linux.so.2 (0xf7748000)

sexta-feira, março 20, 2020

Raspberry Oled Screen with DHT22 Temperature Sensor





The code bellow needs improvements






Need enable i2c and install some libraries... (Python 3.x)

pip3 install --upgrade luma.oled
pip3 install Adafruit_DHT

Optional luma.examples

aptitude install python-dev python-pip libfreetype6-dev libjpeg-dev build-essential
aptitude install i2c-tools libopenjp2-7 libtiff5 python3-dev git
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-18 Richard Hull and contributors
# See LICENSE.rst for details.
# PYTHON_ARGCOMPLETE_OK

"""
Showcase viewport and hotspot functionality.

"""



import datetime
import os
import time
from demo_opts import get_device
from luma.core.virtual import viewport, snapshot
from PIL import ImageFont
import RPi.GPIO as GPIO
import board
from datetime import date
from datetime import datetime
import Adafruit_DHT

tiny_font = ImageFont.truetype(os.path.abspath(os.path.join(
    os.path.dirname(__file__), "fonts", "FreePixel.ttf")), 10)


def right_text(draw, y, width, margin, text):
    x = width - margin - draw.textsize(text, font=tiny_font)[0]
    draw.text((x, y), text=text, font=tiny_font, fill="white")


def title_text(draw, y, width, text):
    x = (width - draw.textsize(text)[0]) / 2
    draw.text((x, y), text=text, fill="yellow")

def position(max):
    forwards = range(0, max)
    backwards = range(max, 0, -1)
    while True:
        for x in forwards:
            yield x
        for x in backwards:
            yield x

def pause_every(interval, generator):
    try:
        while True:
            x = next(generator)
            if x % interval == 0:
                for _ in range(20):
                    yield x
            else:
                yield x
    except StopIteration:
        pass

def render_clock(draw, width, height):
    margin = 3

    now = datetime.now()
    today_date = now.strftime("%d %b %y")
    current_time = now.strftime("%H:%m:%S")

    title_text(draw, margin, width, today_date)
    draw.text((margin + 10, 20), text=current_time, fill="white", font=tiny_font)


def render_temp(draw, width, height):
    humidity, temperature_c = Adafruit_DHT.read_retry(22, 4)
    margin = 3
    
    now = datetime.now()
    today_date = now.strftime("%d %b %y")
    current_time = now.strftime("%H:%m:%S")


    title_text(draw, margin, width, text="Temp DHT22")
    draw.text((margin, 20), text="temperature:", font=tiny_font, fill="white")
    draw.text((margin, 35), text="humidity:", font=tiny_font, fill="white")
    draw.text((margin, 45), text=today_date, font=tiny_font, fill="white")

    right_text(draw, 20, width, margin, text="{0:0.1f}%".format(temperature_c))
    right_text(draw, 35, width, margin, text="{0:0.1f}%".format(humidity))
    right_text(draw, 45, width, margin, text=current_time)
 
def render_temp2(draw, width, height):
    humidity, temperature_c = Adafruit_DHT.read_retry(11, 17)
    margin = 3

    now = datetime.now()
    today_date = now.strftime("%d %b %y")
    current_time = now.strftime("%H:%m:%S")


    title_text(draw, margin, width, text="Temp DHT11")
    draw.text((margin, 20), text="temperature:", font=tiny_font, fill="white")
    draw.text((margin, 35), text="humidity:", font=tiny_font, fill="white")
    draw.text((margin, 45), text=today_date, font=tiny_font, fill="white")

    right_text(draw, 20, width, margin, text="{0:0.1f}%".format(temperature_c))
    right_text(draw, 35, width, margin, text="{0:0.1f}%".format(humidity))
    right_text(draw, 45, width, margin, text=current_time)

def main():
#    widget_width = device.width // 2
    widget_width = device.width
    widget_height = device.height


    temp = snapshot(widget_width, widget_height, render_temp, interval=1.1)
    temp2 = snapshot(widget_width, widget_height, render_temp2, interval=1.0)
    clk = snapshot(widget_width, widget_height, render_clock, interval=1.0)
    clk2 = snapshot(widget_width, widget_height, render_clock, interval=1.0)

    widgets = [temp, temp2, clk, temp2]

    virtual = viewport(device, width=widget_width * len(widgets), height=widget_height)
    for i, widget in enumerate(widgets):
        virtual.add_hotspot(widget, (i * widget_width, 0))

#    for x in pause_every(widget_width, position(widget_width * (len(widgets) - 1))):
#        print("x=",x)
#        virtual.set_position((x, 0))
    x = 0
    while True:
        virtual.set_position((0, 0))
        time.sleep(1)
        #virtual.set_position((128, 0))
        #time.sleep(2)
        #virtual.set_position((256, 0))
        #time.sleep(6)

if __name__ == "__main__":
    try:
        device = get_device()
        main()
    except KeyboardInterrupt:
        pass



systetmd
vi /etc/systemd/system/temperature-widget.service
[Unit]
Description=Temperature sensor to OLED
After=syslog.target

[Service]
Type=simple
WorkingDirectory=/etc/script.d/
RemainAfterExit=yes
ExecStart=/etc/script.d/widget_temp.py
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=multi-user.target