embeded/raspberry pi2021. 9. 17. 13:46

라즈베리 파이 zero에서 USB 메모리 스틱처럼 인식을 시킬수 있다는데

2B나 3B 등에서는 아무래도 회로적으로 USB OTG 구성이 되어 있지 않으니 안될 것 같고

rpi CM4만 해도 OTG가 굽는 용도로 있으니 어떻게 든 가능할 것 같은데.. 확신은 없음

 

반대로 OTG가 존재하는 odroid 등에서는 가능하려나?

 

$ sudo modprobe g_mass_storage removable=1 ro=1

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=223127]

[링크 : https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_USB_Gadget_File_Storage]

'embeded > raspberry pi' 카테고리의 다른 글

rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
rpi 4 lirc tx, rx  (0) 2021.09.23
rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc 제조사별 키코드  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
Posted by 구차니
embeded/raspberry pi2021. 9. 16. 19:18

머가 문제일까..

 

[링크 : https://raspberrypi.stackexchange.com/questions/104008/lirc-irrecord-wont-record-buster-mode2-works]

 

+

stretch가 문제가 아니라

decoded에 문제가 있는지 raw로 하니 잘 된다.

'embeded > raspberry pi' 카테고리의 다른 글

rpi 4 lirc tx, rx  (0) 2021.09.23
rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
lirc 제조사별 키코드  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
rpi 에서 ir 읽기  (0) 2021.09.11
Posted by 구차니
프로그램 사용/minicom2021. 9. 16. 16:20

통신을 주고 받으면서 해당 내용을 파일로 저장하는 기능.

ctrl-a,z 에서 "Capture on/off.....L" 을 눌러 들어가면

+-------------------------------------------------------------------+
|                      Minicom Command Summary                      |
|                                                                   |
|              Commands can be called by CTRL-A <key>               |
|                                                                   |
|               Main Functions                  Other Functions     |
|                                                                   |
| Dialing directory..D  run script (Go)....G | Clear Screen.......C |
| Send files.........S  Receive files......R | cOnfigure Minicom..O |
| comm Parameters....P  Add linefeed.......A | Suspend minicom....J |
| Capture on/off.....L  Hangup.............H | eXit and reset.....X |
| send break.........F  initialize Modem...M | Quit with no reset.Q |
| Terminal settings..T  run Kermit.........K | Cursor key mode....I |
| lineWrap on/off....W  local Echo on/off..E | Help screen........Z |
| Paste file.........Y  Timestamp toggle...N | scroll Back........B |
| Add Carriage Ret...U                                              |
|                                                                   |
|             Select function or press Enter for none.              |
+-------------------------------------------------------------------+

 

저장할 파일명을 물어본다. minicom을 실행한 현재 디렉토리를 기준으로 저장된다.

+-----------------------------------------+
|Capture to which file?                   |
|> minicom.cap                            |
+-----------------------------------------+

'프로그램 사용 > minicom' 카테고리의 다른 글

minicom lf에 cr 붙이기  (0) 2023.01.05
minicom 16진수로 보기  (0) 2022.08.25
minicom timestamp  (0) 2021.09.16
minicom 폭 늘리기  (0) 2021.01.28
/dev/tty 를 sudo 쓰지 않고 사용하기  (0) 2020.09.24
Posted by 구차니
Linux2021. 9. 16. 16:15

라즈베리에 달린 USB 시리얼을 아래와 같이 실행해주고

$ socat /dev/ttyUSB0,raw,echo=0 tcp-listen:8888,reuseaddr

 

putty에서 raw 소켓으로 붙이니

 

양방향으로 소켓을 통해 전송이 가능하다.

로그인은 하고 usbtty로 붙이려면 어떻게 하면 되려나?

[링크 : https://unix.stackexchange.com/questions/201757/]

'Linux' 카테고리의 다른 글

bash multiple session history  (0) 2021.10.01
특정 pts에서 프로그램 실행하기  (0) 2021.09.27
리눅스 콘솔에서 gmail 통해 메일 보내기는 실패 ㅠㅠ  (0) 2021.09.15
linux sw raid  (0) 2021.08.30
glibc 버전 얻기  (0) 2021.07.09
Posted by 구차니
embeded/raspberry pi2021. 9. 16. 15:57

'embeded > raspberry pi' 카테고리의 다른 글

rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
rpi 에서 ir 읽기  (0) 2021.09.11
rpi 3b update, install 실패  (0) 2021.09.10
Posted by 구차니
프로그램 사용/minicom2021. 9. 16. 13:01

minicom에서 "Timestamp toggle...N" 을 누르면

별다른 티를 내지 않고 그냥 나가버리는데

+-------------------------------------------------------------------+
|                      Minicom Command Summary                      |
|                                                                   |
|              Commands can be called by CTRL-A <key>               |
|                                                                   |
|               Main Functions                  Other Functions     |
|                                                                   |
| Dialing directory..D  run script (Go)....G | Clear Screen.......C |
| Send files.........S  Receive files......R | cOnfigure Minicom..O |
| comm Parameters....P  Add linefeed.......A | Suspend minicom....J |
| Capture on/off.....L  Hangup.............H | eXit and reset.....X |
| send break.........F  initialize Modem...M | Quit with no reset.Q |
| Terminal settings..T  run Kermit.........K | Cursor key mode....I |
| lineWrap on/off....W  local Echo on/off..E | Help screen........Z |
| Paste file.........Y  Timestamp toggle...N | scroll Back........B |
| Add Carriage Ret...U                                              |
|                                                                   |
|             Select function or press Enter for none.              |
+-------------------------------------------------------------------+

 

한번 누를 때 마다 다음과 같은 시간 포맷으로 출력된다.

개인적으로는 ms 단위까지 표현해주는게 좋음.

U-Boot
[2021-09-16 14:23:35] U-Boot
[2021-09-16 14:23:55.603] U-Boot 

 

[링크 : https://stackoverflow.com/questions/54377832/extended-timestamp-as-default-in-minicom]

[링크 : https://askubuntu.com/questions/905655/not-able-to-add-timestamp-to-minicom-readings]

 

'프로그램 사용 > minicom' 카테고리의 다른 글

minicom lf에 cr 붙이기  (0) 2023.01.05
minicom 16진수로 보기  (0) 2022.08.25
minicom 로그 저장하기  (0) 2021.09.16
minicom 폭 늘리기  (0) 2021.01.28
/dev/tty 를 sudo 쓰지 않고 사용하기  (0) 2020.09.24
Posted by 구차니
Linux2021. 9. 15. 09:43

smtp 설정이 없어서

[링크 : https://www.tecmint.com/send-email-attachment-from-linux-commandline/]

 

다른걸 찾아보니 ssmtp 라는걸 통해 보내기도 하네?

[<-] 220 smtp.gmail.com ESMTP h8sm1096aae22880pfo.64 - gsmtp
[->] EHLO kali
[<-] 250 SMTPUTF8
[->] STARTTLS
[<-] 220 2.0.0 Ready to start TLS
[->] EHLO kali
[<-] 250 SMTPUTF8
[->] AUTH LOGIN
[<-] 334 VXNlcm5edhbAWU6
[->] dmlzaGFsY2hhasd2dWhhbjIyMTJAZ21haWwuY29t
[<-] 334 UGFzqc3dmvcmQ36
[<-] 235 2.7.0 Accepted
[->] MAIL FROM:<root@kali>
[<-] 250 2.1.0 OK h8smqer10962480pfo.64 - gsmtp
[->] RCPT TO:<crazy@yopmail.com>
[<-] 250 2.1.5 OK h8smqer10962480pfo.64 - gsmtp
[->] DATA
[<-] 354  Go ahead h8sm10962880pfo.64 - gsmtp
[->] Received: by kali (sSMTP sendmail emulation); Thu, 19 Sep 2019 21:45:14 +0530
[->] From: "root" <root@kali>
[->] Date: Thu, 19 Sep 2019 21:45:14 +0530
[->] Hey There! This is a test mail
[->] 
[->] .
[<-] 250 2.0.0 OK  1568909725 h8smqer10962480pfo.64 - gsmtp
[->] QUIT
[<-] 221 2.0.0 closing connection h8smqer10962480pfo.64 - gsmtp

[링크 : https://netcorecloud.com/tutorials/linux-send-mail-from-command-line-using-smtp-server/]

 

mail을 실행하니 mailbox를 열수 없대서 pi 계정을 mail 그룹에 추가했는데도 안되서

해당 디렉토리 생성하니 파일이 필요하다고 배째는 구나 ㅋㅋ

아무튼 파일까진 생성했는데 외부로 메일 어떻게 보내지?

$ mail
Cannot open mailbox /var/mail/pi: Permission denied
No mail for pi

$ sudo adduser pi mail
Adding user `pi' to group `mail' ...
Adding user pi to group mail
Done.

$ sudo mkdir /var/mail/pi
$ mail
Cannot open mailbox /var/mail/pi: Is a directory
No mail for pi
$ sudo rm -rf /var/mail/pi


$ sudo touch /var/mail/pi
$ mail
Cannot open mailbox /var/mail/pi: Permission denied
No mail for pi

$ sudo chown pi:pi /var/mail/pi
pi@raspberrypi:~ $ mail
No mail for pi

[링크 : https://askubuntu.com/questions/350853/]

 

메일 릴레이, 구글 워크스페이스 유료버전일 경우 가능

[링크 : https://support.google.com/a/answer/176600?hl=ko]

 

+



$ echo -e "to: receiver@domain.tld\nsubject: subject\n"| (cat - && uuencode /path/to/attachment attachment.name) | ssmtp receiver@gmail.com

[링크 : https://unix.stackexchange.com/questions/44043/how-can-i-send-attachment-with-ssmtp-in-linux]

uuencode 설치하려면 아래 패키지가 필요하다.

$ sudo apt-get install sharutils

[링크 : https://askubuntu.com/questions/232440/how-do-i-install-uudecode]

 

On ubuntu/debian, this file is in /etc/ssl/certs/ca-certificates.crt. You could symlink it. The /etc/pki/ path is used on Redhat.

[링크 : https://askubuntu.com/questions/342484/etc-pki-tls-certs-ca-bundle-crt-not-found]

 

+

마지막 줄은 에러로 뜨는데 도대체 멀까 ㅠㅠ

[<-] 220 smtp.gmail.com ESMTP y5sm1106947pfb.207 - gsmtp
[->] EHLO raspberrypi
[<-] 250 SMTPUTF8
[->] STARTTLS
[<-] 220 2.0.0 Ready to start TLS
[->] EHLO raspberrypi
[<-]
ssmtp:  (raspberrypi)

 

+

구글 보안때문에 안되는건가...

[링크 : https://medium.com/swlh/setting-up-gmail-and-other-email-on-a-raspberry-pi-6f7e3ad3d0e]

'Linux' 카테고리의 다른 글

특정 pts에서 프로그램 실행하기  (0) 2021.09.27
socat을 이용한 ttyUSB to TCP  (0) 2021.09.16
linux sw raid  (0) 2021.08.30
glibc 버전 얻기  (0) 2021.07.09
쉘스크립트 반복 실행(인자로 준 횟수 만큼)  (0) 2021.06.11
Posted by 구차니

마지막 커밋 1개 날리고, 강제로 서버에 푸시

$ git reset --hard HEAD~1
$ git push -f

 

그래도 이력을 남기는 revert가 좋을 듯.

다만 돌릴게 많으면 돌렸다는 이력 자체도 잔뜩 생긴다고 하니

되돌릴일을 만들지 않는게 최선.. ㅠㅠ

$ git revert [hash]

 

[링크 : https://jupiny.com/2019/03/19/revert-commits-in-remote-repository/]

'프로그램 사용 > Version Control' 카테고리의 다른 글

git diff --staged  (0) 2022.09.05
git blame  (0) 2021.06.21
git pull rebase 설정  (0) 2021.06.02
git log --stat  (0) 2021.05.10
git stash  (0) 2021.05.09
Posted by 구차니
embeded/odroid2021. 9. 14. 20:21

 

$ cat /etc/lirc/lirc_options.conf
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
#driver          = devinput
#device          = auto
driver          = default
device          = /dev/lirc0
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/aarch64-linux-gnu/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#release        = true
#release_suffix = _EVUP
#logfile        = ...
#driver-options = ...

[lircmd]
uinput          = False
nodaemon        = False

[modinit]
code = /sbin/modprobe meson-ir
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...


[lircd-uinput]
add-release-events = True
release-timeout    = 50
release-suffix     = _EVUP
# add-release-events = False
# release-timeout    = 200
# release-suffix     = _EVUP

 

 

$ ls -al /dev/lirc*
ls: cannot access '/dev/lirc*': No such file or directory
$ sudo service lircd restart
$ ls -al /dev/lirc*
crw-rw---- 1 root video 230, 0 Sep 14 10:35 /dev/lirc0

 

[링크 : https://wiki.odroid.com/odroid-c2/application_note/lirc/lirc_ubuntu18.04]

 

 

[링크 : https://wiki.odroid.com/common/application_note/gpio/ir/lirc_gpioir_ubuntu18.04#tab__odroid-c2]

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/ir]

 

 

[링크 : https://forum.odroid.com/viewtopic.php?t=14201]

  [링크 : https://odroid.com/dokuwiki/doku.php?id=en:c2_enhancement_gpio40]

  [링크 : https://odroid.com/dokuwiki/doku.php?id=en:c2_hardware#expansion_connectors]]

 

+

Pin #11 (GPIO #247) /  왼쪽 위에서 6번째(5번째는 GND)

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/lirc_gpio_blaster#tab__odroid-c2]

 

$ service lircd stop
$ modprobe lirc_dev
$ modprobe lirc_odroid gpio_out_pin=247 softcarrier=1 invert=1
$ service lircd restart

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/lirc_gpio_blaster/irblaster_lirc_setup_ubuntu18.04#tab__odroid-c2]

'embeded > odroid' 카테고리의 다른 글

odroid c2 lircd output 성공  (0) 2021.09.18
lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)  (0) 2021.09.17
odroid c2 i2c  (0) 2021.09.11
odroid c2 wiringpi pinout  (0) 2021.09.10
odroid c2 gpio wiringpi  (0) 2021.09.09
Posted by 구차니

어우 야근 빡세다

보안때문에 핸드폰으로원격 빌드하고

원격 이메일 전송은 못하니 이것도 언넝 해결해야지 ㅠㅠ

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

피곤피곤  (0) 2021.09.20
경험이 능력을 만든다.  (0) 2021.09.19
으아아아아  (0) 2021.09.07
휴가인데 야근  (0) 2021.09.03
윈도우 어플 울렁증?  (0) 2021.08.29
Posted by 구차니