집에 TV 2대

거실 Btv 시청 (삼성 65')

안방 크롬캐스트로 TV 시청(스마트라 저가 42')

 

안방에서도 정규방송을 보기위해 찾던중 IPTV IPC 스캔이 있음.

 

구성 (공유기에서 IPTV 설정이 있어야함 (IGMP Proxy)
BTV 셋톱박스 와 스캔을위한 PC가 같은 망에 구성되아야 함.

 

MctvPlaylistCreator 사용하여 스캔 

MctvPlaylistCreator 검색하면 잘 정리되어있는 사이즈 많음.

 

Raspberry Pi1 보유 

PVR-simple iptv 라는 걸로 시청.

느려서 그런지.. 1~2초 나오다가 끊김.. 

 

Raspberry Pi4 보유

debian을 처음 발매했던걸 올렸더니.. KODI가 개판.. 

최신 버전으로 debian을 설치하고 KODI 재설치 PVR-simple iptv도 잘 됨.

NAS에 m3u 파일을 업데이트하여 m3u 파일 링크 걸어둠.

 

시청 끊김없이 아주 잘나옴.

 

# 어려웠던 점.

처음 IPTV 스캔한다고 OMVP 접근...

PC에도 설치하고 스캔.... 겁나 안됨.
(2020.04.11- 2시간 이상 넘어가니 하나씩 생김. MctvPlaylistCreator 에서 못찾던 것도 찾음.. )

NAS에 설치하려고 도전... OS ubuntu , debian 둘다 설치 실패... 너무 옛날 물건으로 해서그런가봄. 패스

 

# 결론

MctvPlaylistCreator를 PC에 설치하고 스캔.

잘됨~ 아주 잘되는 거 같음. 스캔하는데 시간이 필요함.

스캔도중 시청 잘안됨. 인터넷 불안정함. 한번은 끊긴적 있음. 공유기가 멈춤
(예상원인... 망구성이 불안정한것으로 예상됨)

아직도 MBC 채널은 못찾음. 

omvp를 PC 설치 스캔 (찾아보면 잘 나와있음)

모든 채널 다 스캔 한거 같음. 사용하기도 편함

1. Kodi 설치하기... 인터넷에서 찾아보면 많이 나옴.

2. Kodi 한글설정... 인터넷에서 찾아보면 잘 나와있음.

3. 위 과정을 다 했는데 한글패치가 안될경우 따라하면 됩니다. 

패치방법 : 한글폰트를 복사해서 붙여넣을 예정 (대상 : arial.ttf)

원하는 한글폰트를 복사해서 Raspbian에 넣어두고 arial.ttf폰트롤 대처하면 됩니다. 

(간단한 복사 USB이용해서 옴기기, 

arial.ttf 폰트위치는 cd /usr/share/kodi/media/Fonts

 

복사하는법

cp 폰트파일.ttf /usr/share/kodi/media/Fonts/arial.ttf

주로 다운로드 받는 사이트

https://archive.org/details/MAME2003_Reference_Set_MAME0.78_ROMs_CHDs_Samples

 

Retropie에서 2000, 2003, 2010 애뮬레이터만 있는거 같음... 기억이 가물가물...

사이트 들어가면 2003버전이 제일 많고 잘 실행됨.

 

 

 

1. 기본으로 라즈베리 공식홈페이지에서 Raspbian 설치 - 기본이라 검색하면 다 나와있음

2. RetroPie 설치하기 (https://retropie.org.uk/download/) 접속

 

 

   Installing on top of an existing os 에서

   Raspbian on a Raspberry Pi

   For installing on top of Raspbian Jessie please see https://retropie.org.uk/docs/Manual-Installation/

   접속해서 설명된데로 설치한다.

3.  sudo ./retropie_setup.sh 에서 Error가 발생함 - 보드와 매칭이 안되서 그런거 같음

   sudo __platform=rpi3 ~/RetroPie-Setup/retropie_setup.sh

   이렇게 입력해주면 스크립트가 나옴 그러면 계속 진행하면 됨

4. 설치가.... 쫌 많이 오래 걸림... 한 2시간?? 다 설치가 되면
    EmulationStation 을 입력하면 RetroPie가 실행 됨

집에 라즈베리1, 큐비보드1를 서버로 사용중..

 

라즈베리1 - 토렌트 서버사용 ... 1TB 하드사용하다가 뻑나서 굴러다니는 500GB로 토렌트 머신으로만 사용

큐비보드1 - 내 파일 서버로사용

 

공유기HDD - 4TB연결하여 사진서버로 사용할려고 계획했다.

 

파일을 옴기기 위해서 리눅스에서 다른하드를 연결하기위해 리눅스에서 samba 마운팅을 찾아봄

검색해보면 잘나와있는데... 나는 왜 연결이 안될까...

 

리눅스에서 삼바가 접속되는지 확인한다.

처음 : smbclient //192.168.0.1/HDD1 -U 계정

 

기본 : mount -t cifs -o user=계정,pass=암호 //주소/공유폴더 /공유할/디렉토리

Error 메시지 :

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

 

별에별 옵션을 다 넣어줬는데도 안된다....

찾다가 찾다가 결국 해보라는 옵션은 다해봄

 

최종 성공

mount -t cifs -o user=계정,pass=암호,sec=ntlm,vers=1.0 //192.168.0.1/HDD1 /mnt/iptime_HDD/

.... 삼바통해서 접속하니 한글이 깨짐...

 

mount -t cifs -o user=계정,pass=암호,sec=ntlm,vers=1.0,iocharset=utf8 //192.168.0.1/HDD1 /mnt/iptime_HDD/

 

참고 사이트

https://openwiki.kr/tech/mount_cifs

https://jazzlife.tistory.com/28

https://linux.die.net/man/8/mount.cifs

https://unix.stackexchange.com/questions/64420/cannot-mount-samba-share-mount-error-22

13' LCD 디스플레이어 

왼쪽위 - 디스플레이어 보드, 가운데 - 라즈베리파이4, 오른쪽아래 - USB 충전기, DC/DC 아답터

개요
스위치를 이용하여 BootSelect 하기위해 기본적인 python을 이용한 print 시험
구성
 
소스코드
#i /user/bin/python

from gpiozero import Button
import subprocess

if Button(2).is_pressed & Button(4).is_pressed:
        print('Gpio_2 & Gpio_4')

elif (not Button(2).is_pressed) & Button(4).is_pressed:
        print('Gpio_4')

elif (not Button(4).is_pressed) & Button(2).is_pressed:
        print('Gpio_2')

else:
        print('Not Input')
결과
 

 

 

 

목적 : 이동식 Mame게임기 및 Kodi 미디어 플레어 만들기

준비 (국내 온라인 사이트에서 구할수가 없어서 AliExpress에서 구매 진행) (약 $1 = \1,200)

1) Raspberry Pi4 - 4Gb                $ 65.52 X1

https://ko.aliexpress.com/item/4000054868537.html?spm=a2g0s.9042311.0.0.683d4c4d07fy7P

2) Raspberry Pi4 방열 케이스        $ 15.19 X1

https://ko.aliexpress.com/item/4000061381216.html?spm=a2g0s.9042311.0.0.683d4c4d07fy7P

3) 게임패드                              $ 26.38 X2

https://ko.aliexpress.com/item/32840716891.html?spm=a2g0s.9042311.0.0.683d4c4d07fy7P

4) 13'3인치 Display 모듈              $ 49.40 X1

https://ko.aliexpress.com/item/4000112143939.html?spm=a2g0s.9042311.0.0.683d4c4d07fy7P

5) 기타 : 충전기 5V/3A, USB-C Type Cable, micro HDMI Cable   약\20,000원

6) 아크릴 케이스 : 예상비용 : 3만3천7백원 - 기본적인 설계는 완료했으나. Display 모듈 입고 후 확인하고 제작 예정

https://www.acryiae.com/front/mypage/orderList.do

총 금액 $156.49 + 2만 + 3만3천7백‬ = \241,488‬원

 

많이도 들어갔내... 

 

진행상황

Mame 적용완료,

Mame 2000, 2003, 2010 게임 실행 완료

Kodi 한글화 적용완료,

 

앞으로 진행

전원 인가시 스위치모드에 따라서 RetroPi 부팅, Kodi 부팅, Raspbian 부팅 설정예정 - 완료
  스위치 자동 실행시 RetroPi 게임 실행 안되는 문제 있음.

 

 

Ultrasonic_RADAR.exe
0.01MB

 

 

#소스코드
using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 
using System.IO.Ports; 

namespace Ultrasonic_RADAR 
{ 
    public partial class Form1 : Form 
    { 
        // 시리얼 관련 변수 
        string dataIN;  //시리얼 읽기 
        double number1;   //문자 -> 부동소수점으로 변경 

        int measure_flag = 0; 
        // 레이더 그리기 
        Timer t = new Timer(); 
        int width = 400, height = 400, Hand = 200; 
        int u;  
        int cx, cy;  
        int x, y;  
        int tx, ty, lim = 20; 

        Bitmap bmp; // 픽셀 
        Pen p;      // 선 
        Graphics g; 
         
        public Form1() 
        { 
            InitializeComponent(); 
        } 

        private void Form1_Load_1(object sender, EventArgs e) 
        { 
            // 시리얼 포트 초기화 
            string[] ports = SerialPort.GetPortNames(); 
            cBoxCOMPORT.Items.AddRange(ports); 

            // 레이더 그리기 초기화 
            bmp = new Bitmap(width + 1, height + 1); 
            this.BackColor = Color.Gray;  

            //center  
            cx = width / 2;  
            cy = height / 2;  

            //initial degree of HAND  
            u = 0;  

            //timer              
            //t.Interval = 5; //in millisecond  
            //t.Tick += new EventHandler(this.t_TICK);  
            //t.Start();          
        } 
         
        private void t_TICK(object sender, EventArgs e)  
        {  
            //pen  
            p = new Pen(Color.Green, 1f);  

            //graphics  
            g = Graphics.FromImage(bmp);  

            //calculate x, y coordinate of HAND  
            int tu = (u - lim) % 360;  

            if (u >= 0 && u <= 180)  
            {  
                //right half  
                //u in degree is converted into radian.  

                x = cx + (int)(Hand * Math.Sin(Math.PI * u / 180));  
                y = cy - (int)(Hand * Math.Cos(Math.PI * u / 180));  
            }  
            else  
            {  
                x = cx - (int)(Hand * -Math.Sin(Math.PI * u / 180));  
                y = cy - (int)(Hand * Math.Cos(Math.PI * u / 180));  
            }  


            if (tu >= 0 && u <= 180)  
            {  
                tx = cx + (int)(150 * Math.Sin(Math.PI * tu / 180));  
                ty = cy - (int)(150 * Math.Cos(Math.PI * tu / 180));  
            }  
            else  
            {  
                tx = cx - (int)(150 * -Math.Sin(Math.PI * tu / 180));  
                ty = cy - (int)(150 * Math.Cos(Math.PI * tu / 180));  
            }  

            // draw circle  
            g.DrawEllipse(p, 0, 0, width, height); //bigger circle  
//            g.DrawEllipse(p, 80, 80, width - 160, height - 160); //smaller circle  

            // draw perpendicular line  
//            g.DrawLine(p, new Point(cx, 0), new Point(cx, height)); // UP-DOWN  
//            g.DrawLine(p, new Point(cy, 0), new Point(cy, width)); //LEFT-RIGHT  

            //draw HAND  
//            g.DrawLine(new Pen(Color.White, 1f), new Point(cx, cy), new Point(tx, ty));  
            g.DrawLine(p, new Point(cx, cy), new Point(x, y)); 
            if (serialPort1.IsOpen) 
            { 
                g.DrawLine(new Pen(Color.Red, 1f), new Point(x-1, y-1), new Point(x, y)); 
            } 
            // load bitmap in picturebox1  
             

            // 해제 
            p.Dispose();  
            g.Dispose(); 

            //update              
            if (u == 360)             
            { 
                u = 0; 
                measure_flag = 0; 
                bmp = new Bitmap(width + 1, height + 1); 
                serialPort1.Write("0"); 
            }else 
                pictureBox1.Image = bmp;  
        } 

        private void btnOpen_Click(object sender, EventArgs e) 
        { 
            try 
            { 
                serialPort1.PortName = cBoxCOMPORT.Text; 
                serialPort1.BaudRate = Convert.ToInt32(cBoxBaudRate.Text); 
                serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived); 

                serialPort1.Open(); 
                progressBar1.Value = 100; 
            } 

            catch (Exception err) 
            { 
                MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 
            } 
        } 

        private void btnCLose_Click_1(object sender, EventArgs e) 
        { 
            if (serialPort1.IsOpen) 
            { 
                serialPort1.Close(); 
                progressBar1.Value = 0; 
            } 
        } 
        private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)     //시리얼 데이터 읽기 
        { 
            if (measure_flag == 1) 
            { 
                dataIN = serialPort1.ReadExisting(); 
                try 
                { 
                    number1 = System.Convert.ToDouble(dataIN); 
                } 
                catch (FormatException) 
                { 
                } 
                catch (OverflowException) 
                { 
                } 
                Hand = (int)number1;    //그리기-값                    
                 
                serialPort1.Write("1"); 

                this.Invoke(new EventHandler(ShowData)); 
                this.Invoke(new EventHandler(t_TICK)); 
                 
                u++; 
            } 

        } 
        private void ShowData(object sender, EventArgs e)   //Data 출력 
        {             
            this.label3.Text = dataIN;                         
        } 

        private void Measure_Click(object sender, EventArgs e) 
        { 
            measure_flag = 1; 
            serialPort1.Write("1"); 
        } 
    } 
}

 

#define H 1
#define L 0
#define trigpin 11
#define echopin 12
#define delay_time 10

int Motor[4] = {4,5,6,7};
int M_En[2] = {8,9};
int i, deg = 0;
int flag = 0;
float duration, distance;  

void setup() {
  for (i=0;i<4;i++){
    pinMode(Motor[i], OUTPUT);
  }
  for (i=0;i<2;i++){
    pinMode(M_En[i], OUTPUT);
  }  
  pinMode(trigpin, OUTPUT);   //Trig
  pinMode(echopin, INPUT);   //Echo 
  Serial.begin(115200); //보레이트 설정
}

void M_Enable(){
  for (i=0;i<2;i++){
    digitalWrite(M_En[i], H);
  }  
}

void M_Disable(){
  for (i=0;i<2;i++){
    digitalWrite(M_En[i], L);
  } 
}

void UltraSonic_command(){
/////////////////////////UltraSonic 동작 및 거리계산
////////////////////////////////////////////////// 대충 검색해서 퍼옴 - 구지... 이해할필요까지.. 없어보임.
  digitalWrite(trigpin, H);
  delay(10);
  digitalWrite(trigpin, L);
  duration = pulseIn(echopin, H);
  distance = ((float)(340*duration) / 10000) /2 ;
/////////////////////////시리얼로 프린트? TX 구문인지... 
  //Serial.print("distance : ");
  Serial.println(distance);
}

// 한스텝 동작 -> 거리측정 -> Serial Send
void M_move(int a, int b, int c, int d){
  M_Enable();
  digitalWrite(4, a);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(5, b);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(6, c);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(7, d);   // turn the LED on (HIGH is the voltage level) 
  UltraSonic_command();
  M_Disable();  
}

// 오른쪽 동작
void r_Stepping(){  
  M_move(H,L,L,H);  
  delay(delay_time);                       // wait for a second
  M_move(H,H,L,L);  
  delay(delay_time);                       // wait for a second
  M_move(L,H,H,L);  
  delay(delay_time);                       // wait for a second
  M_move(L,L,H,H);  
  delay(delay_time);                       // wait for a second
}

// 왼쪽 동작
void l_Stepping(){  
  M_move(L,L,H,H);  
  delay(delay_time);                       // wait for a second
  M_move(L,H,H,L);    
  delay(delay_time);                       // wait for a second
  M_move(H,H,L,L);  
  delay(delay_time);                       // wait for a second
  M_move(H,L,L,H);  
  delay(delay_time);                       // wait for a second
}

// 오른쪽 360도 -> 왼쪽 360도 
void loop() { 
  if(Serial.available()>0){
    flag = Serial.read();
  }  
  if(flag){
    l_Stepping();  
    if(deg < 52)    
      deg = deg + 1; 
    else {
      flag = 0;          
      deg = 0;
    }
  }
}

+ Recent posts