พอดีว่า มีงานที่ต้องหา public ip เพื่อให้เครื่องข้างนอก สามารถ remote เข้ามาได้
มี code ดังนี้
https://github.com/kongimi/getPublicIP.git
ที่มา
https://www.esp8266.com/viewtopic.php?f=6&t=12782
blog นี้จะกล่าวถึง Raspberry Pi Raspbian เป็นหลัก โดยจะอธิบายทั้งการใช้ windows และ Linux ในการเชื่อมต่อ วิธีอ่าน : ให้เริ่มอ่านตั้งแต่หัวข้อแรกๆขึ้นมา(ให้ดูที่ "คลังบทความ" ทางด้านขวามือ จะมี วัน-เวลา ไล่เรียงอยู่) ไม่งั้นอาจจะงงได้ สำหรับมือใหม่ หรือท่านใดที่ไม่เข้าใจ สามารถ mail มาถามกันได้ครับ ที่ kongimi1980@gmail.com หรือที่ line : 0814282425
พอดีว่า มีงานที่ต้องหา public ip เพื่อให้เครื่องข้างนอก สามารถ remote เข้ามาได้
มี code ดังนี้
https://github.com/kongimi/getPublicIP.git
ที่มา
https://www.esp8266.com/viewtopic.php?f=6&t=12782
วันนี้ได้มีโอกาสทำ arduino และ ต้องการจะอ่าน serial number จาก arduino
เริ่มต้นจาก google ค้นหาคำว่า arduino serial number และได้พบว่า arduino มันไม่มี serial number แต่มันจะมีอะไรบางอย่างที่ใช้แทนได้ เขาเรียกว่า "UniqueID" และเขาก็ได้ทำ library มาให้เรา download เรียบร้อย
#include <ArduinoUniqueID.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(19200,SERIAL_8N1);
UniqueIDdump(Serial);
}
void loop() {
// put your main code here, to run repeatedly:
}
ที่มา
https://www.thethingsnetwork.org/forum/t/arduino-has-a-unique-id/21415
https://github.com/ricaun/ArduinoUniqueID
http://ww1.microchip.com/downloads/en/DeviceDoc/40001906A.pdf
สวัสดีครับ
วันนี้ได้ทำ LCD 7" touch screen ตัวนี้
และต้องทำให้หมุน 270 องศา มีวิธีการดังนี้
1.sudo nano /boot/config.txt
2.เพิ่ม display_rotate=3 บนบรรทัดแรกสุด
3.แก้ไขจาก dtoverlay=vc4-fkms-v3d ให้เป็น #dtoverlay=vc4-fkms-v3d
4.control+o, control+x
ยังไม่จบ เราต้องปรับ touch screen ให้หมุนตามหน้าจอ ดังนี้
1.sudo apt-get install xserver-xorg-input-libinput
2.sudo mkdir /etc/X11/xorg.conf.d
3.sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
4. sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
5.ให้มองหาคำว่า "touchscreen" แล้วเพิ่มบรรทัดนี้เข้าไป
Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
6.control+o, control+x
7.sudo reboot
เท่านี้เราก็สามารถหมุนหน้าจอให้เป็น 270 องศา และ touch screen ได้อย่างถูกต้องแล้ว
ถ้าต้องการปรับหมุนหน้าจอเป็นแบบอื่น
https://www.waveshare.com/w/index.php?search=calibrationmatrix&title=Special%3ASearch&fulltext=Search
สำหรับ 90 องศา ให้ดูตามด้านล่าง
display_rotate=1 #1:90;2: 180; 3: 270
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
ที่มา
https://www.waveshare.com/wiki/7inch_HDMI_LCD_(B)
wget http://download.qt.io/official_releases/qt/5.12/5.12.7/single/qt-everywhere-src-5.12.7.tar.xzที่มา https://www.tal.org/tutorials/building-qt-512-raspberry-pi
md5sum qt-everywhere-src-5.12.7.tar.xz
ควรจะมีผลลลัพธ์ตามนี้
ce2c5661c028b9de6183245982d7c120 qt-everywhere-src-5.12.7.tar.xz
sudo apt-get install build-essential
=========== ตรงนี้ไม่แน่ใจว่าต้องทำหรือไม่ ======================
git clone https://github.com/oniongarlic/qt-raspberrypi-configuration.git
cd qt-raspberrypi-configuration && make install DESTDIR=../qt-everywhere-src-5.12.7ตรงนี้ให้แก้เป็น
while IFS= read -r line; do
echo "Text read from file: $line"
done < /tmp/TagAgent.pid
tar -xvzf /path/to/yourfile.tgz
sudo apt-get update sudo apt-get install pi-bluetoothsudo apt-get install bluetooth bluezsudo apt-get install python-bluezsudo hciconfig hci0 piscansudo hciconfig hci0 name 'Device Name' // change Device Namesudo python /usr/share/doc/python-bluez/examples/simple/inquiry.pyเพื่อดูว่า ตอนนี้ raspberry pi ของเรา มองเห็น Bluetooth Custom printer รุ่น MY3 หรือยัง ถ้าเห็นแล้ว จะขึ้นแบบนี้