Quick jump:  What's new

 
Go to:
 
Weblog: recent changes   
in Dobrica Pavlinušić's random unstructured stuff
Arduino


Nano 3.0 Atmega328P-AU

http://dx.com/p/arduino-nano-v3-0-81877

but it doesn't work without bootloader

http://club.dx.com/forums/forums.dx/threadid.1185512
http://club.dx.com/forums/forums.dx/threadid.1218851

avrdude

dpavlin@blue:~$ avrdude -c buspirate -P /dev/ttyUSB0 -p m328p -v

avrdude: Version 5.11.1, compiled on Mar 24 2013 at 00:54:55
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/dpavlin/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : buspirate
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : BusPirate
         Description     : The Bus Pirate

Detecting BusPirate...
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RE
avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC
avrdude: buspirate_readline(): Firmware v6.1 r1676  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
avrdude: buspirate_readline(): http://dangerousprototypes.com
avrdude: buspirate_readline(): HiZ>
**
BusPirate: using BINARY mode
BusPirate binmode version: 1
BusPirate SPI version: 1
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as 7

avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as 7
avrdude: safemode: Fuses OK
BusPirate is back in the text mode

avrdude done.  Thank you.

bootloader update

bus pirate

http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming

But which bootloader to use? (hint: not optiboot!)

dpavlin@blue:~$ ard-parse-boards nano328 bootloader.file
ATmegaBOOT_168_atmega328.hex

Ok, now flash it!

dpavlin@blue:~$ avrdude -c buspirate -P /dev/ttyUSB0 -p m328p -U flash:w:/usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex

Detecting BusPirate...
**
BusPirate: using BINARY mode
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex"
avrdude: input file /usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex auto detected as Intel Hex
avrdude: writing flash (32670 bytes):

Writing | ################################################## | 100% 56.84s

avrdude: 32670 bytes of flash written
avrdude: verifying flash memory against /usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:
avrdude: load data flash data from input file /usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:
avrdude: input file /usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex auto detected as Intel Hex
avrdude: input file /usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex contains 32670 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 55.22s

avrdude: verifying ...
avrdude: 32670 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

After re-flash using bus pirate as ISP from Arduino GUI fuses changed:

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK

usbasp bootloader update

Sun Jan 12 11:27:34 2020] usb 8-2: new low-speed USB device number 4 using uhci_hcd
[Sun Jan 12 11:27:34 2020] usb 8-2: New USB device found, idVendor=16c0, idProduct=05dc, bcdDevice= 1.02
[Sun Jan 12 11:27:34 2020] usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Sun Jan 12 11:27:34 2020] usb 8-2: Product: USBasp
[Sun Jan 12 11:27:34 2020] usb 8-2: Manufacturer: www.fischl.de

dpavlin@x200:~$ avrdude -v -patmega328p -cusbasp

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/dpavlin/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : usbasp
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF)

avrdude done.  Thank you.

flash ond nano bootloader

this is old nano bootloader, it doesn't work on 115200 but on 57600 with avrdude

dpavlin@x200:~$ avrdude -v -patmega328p -cusbasp -U flash:w:/tmp/nuc/opt/arduino/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex

flash optiboot

dpavlin@x200:~$ avrdude -v -patmega328p -cusbasp -U flash:w:/tmp/nuc/opt/arduino/hardware/arduino/avr/bootloaders/optiboot/optiboot_atmega328.hex

add bus pirate to arduino GUI

http://taylanayken.wordpress.com/2011/05/04/using-bus-pirate-with-arduino-ide/

root@blue:~# grep buspirate /usr/share/arduino/hardware/arduino/programmers.txt
buspirate.name=The Bus Pirate
buspirate.communication=serial
buspirate.protocol=buspirate

Simulators/Emulators

emulino

console output, somewhat large network on github

https://github.com/ghewgill/emulino

simuino

ncurses interface, single stepping, doesn't have source control link, can't compile it

http://code.google.com/p/simuino/

emulare

Requres .net, need to test it with mono

http://emulare.sourceforge.net/

simavr

programming sketches

DebugWire protocol

http://www.ruemohr.org/docs/debugwire.html

Internal ADC reference

https://github.com/SensorsIot/ADC_Test/blob/master/ADC_Test.ino

permalink
MH-Z19B

    Product model number: MH-Z19B
    Gas Detection: Carbon Dioxide
    Supply voltage: 4.5~5.5V DC
    Average current: <20mA (@5V power supply)
    Peak current: 150 mA (@5V supply)
    Interface level: 3.3V (5V compatible)
    Measurement range: 0~10000ppm can be selected within the range
    Warm-up time: 3min
    Response time: T90<120s
    Working temperature: 0~50°C
    Operating Humidity: 0 to 95% RH (non-condensing)

arduino

https://github.com/satr/arduino-with-co2-sensor-mh-z19b-and-lcd-display-nokia-5110

https://github.com/tobiasschuerg/MH-Z-CO2-Sensors

https://github.com/strange-v/MHZ19

https://github.com/arendst/Tasmota/wiki/MH-Z19B

permalink
LGT8F328P
permalink
DRAC

Dell DRAC is very bad remote KVM which doesn't age well at all. Only way I found which works to have keyboard work is to use Windows XP for iDRAC7 on PowerEdge R720 which is just junk.

There is very nice fix for keyboard problems on Linux at

https://github.com/anchor/idrac-kvm-keyboard-fix

which doesn't work for me but might be worth exploring.

To make it work at all on Linux I did:

apt install icedtea-netx

Modified /etc/java-11-openjdk/security/java.security to remove everything which disables old and broken cipers which are required for DRAC 7 to work

klin:/etc# git show java-11-openjdk/security/java.security
commit 2af32fcc93a6480821dc69ef7540c7979dc4c86b (HEAD -> master)
Author: root <root@klin.ffzg.hr>
Date:   Tue Nov 12 06:25:03 2019 +0100

    daily autocommit

diff --git a/java-11-openjdk/security/java.security b/java-11-openjdk/security/java.security
index 0c87fe11..848454b9 100644
--- a/java-11-openjdk/security/java.security
+++ b/java-11-openjdk/security/java.security
@@ -576,8 +576,8 @@ krb5.kdc.bad.policy = tryLast
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \
-    RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224
+#jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \
+#    RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224

 #
 # Algorithm restrictions for signed JAR files
@@ -620,8 +620,8 @@ jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \
 #
 # See "jdk.certpath.disabledAlgorithms" for syntax descriptions.
 #
-jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
-      DSA keySize < 1024
+#jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
+#      DSA keySize < 1024

 #
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
@@ -653,8 +653,8 @@ jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
 #
 # Example:
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
-jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
-    EC keySize < 224, 3DES_EDE_CBC, anon, NULL
+#jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
+#    EC keySize < 224, 3DES_EDE_CBC, anon, NULL

 #
 # Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)

permalink
PMS3003

http://git.rot13.org/?p=air-quality;a=blob;f=pms3003.pl;hb=HEAD

PMS3003 series data manual_English_V2.5.pdf

http://www.plantower.com/en/content/?107.html

http://aqicn.org/sensor/pms3003/

https://github.com/avaldebe/AQmon/blob/master/Documents/PMS3003_LOGOELE.pdf (different manufacturer)

http://download.kamami.pl/p563980-PMS3003%20series%20data%20manual_English_V2.5.pdf



spec

    Parameters :Index (Unit )
    Measuring range: 0.3-1.0um ; 1.0-2.5um ; 2.5-10um

Measurement units: ug/m3
3 Measurement accuracy: ug/m3
4 Response time: <10s
5 Work current: 5V200ma@ Work State 5V2ma@ Standby Fitness

    Counting efficiency :50%@0.3um 98% @> = 0.5 um
    Response time :≤ 10 sec
    DC supply voltage :5 V
    Operating current :120 mA
    Standby Current :≤ 200 µA
    Data interface level :L <0.8 @ 3.3 H> 2.7@3.3 V
    Operating temperature range :-20 ~ + 50 °C
    Operating humidity range :0 to 99%
    MTBF :≥ 3 Year
    Size :65 × 42 × 23 mm

pinout

    PIN1 :VCC :Power Supply (5V).
    PIN2 :GND :Ground.
    PIN3 :SET :Standby mode (when 0), operating mode (when 1) TTL 3V3
    PIN4 :RXD :Serial receive / TTL level @ 3.3V.
    PIN5 :TXD :Serial transmit / TTL level @ 3.3V.
    PIN6 :RESET :Module reset / TTL level @ 3.3V.
    PIN7,8 :NC :Not connected.

serial

9600

starts with 0x42 0x4d

Byte buffer index Description
1 – Constant value (0x42)
2 0 Constant value (0x4d)
3 1 Frame length
4 2
5 3 PM1.0 concentration unit (μg/m3)
6 4
7 5 PM2.5 concentration unit (μg/m3)
8 6
9 7 PM10 concentration unit (μg/m3)
10 8
11 9 PM1.0 concentration unit under atmospheric environment (μg/m3)
12 10
13 11 PM2.5 concentration unit under atmospheric environment (μg/m3)
14 12
15 13 PM10 concentration unit under atmospheric environment (μg/m3)
16 14
17 15 reserved
18 16
19 17 reserved
20 18
21 19 reserved
22 20
23 21 Control sum
24 22

code

Arduino

doesn't check checksum: https://github.com/suda/PMS3003/blob/master/src/PMS3003.cpp

much better library: https://github.com/fu-hsi/pms

Node MCU

https://github.com/avaldebe/AQmon/blob/master/lua_modules/pms3003.lua

permalink
ZPH02-PM2.5
ZPH02.pdf

http://git.rot13.org/?p=air-quality;a=blob;f=zph02.pl;hb=HEAD

Technical Parameters

Model ZPH02
Working voltage range 5 +/- 0.2 V (DC)
Output way Rate of low level%(recommending 30s)
Output signal voltage 5 +/- 0.2 V
Detection ability smallest particles 1 μm diameter
Warm-up time
Working current
Storage
Humidity
≤1min(device warming-up time)
≤90mA
≤95%RH
range Working ≤95%RH
Temperature
range Storage
Working -30 deg. C~50 deg. C
0�C~50�C
Size 59.5�44.5�20mm(L�W�H)
Physical interface EH2.54-5P

pinout

PIN No. PMW mode UART mode
PIN1 GND GND
PIN2 NC TXD
PIN3 VCC VCC
PIN4 PWM NC

| PIN5 | NC | Connects to GND |
permalink
CT sensors
permalink
Xiaomi Mi 5

Snapdragon 820 Quad-core Kryo 1.8GHz
Adreno 530 GPU
3GB LPDDR4 dual-channel RAM
32GB UFS 2.0 Flash

permalink
Sony Xperia T3

https://wiki.postmarketos.org/wiki/Sony_Xperia_T3_(sony-seagull)

https://en.wikipedia.org/wiki/Sony_Xperia



Hardware

Chipset Qualcomm MSM8928 Snapdragon 400
CPU Quad-core 1.4 GHz
GPU Adreno 305
Display 720x1280 TFT
Storage 8 GB + SD card
Memory 1 GB

unlock bootloader

https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/

Please note! It will only be possible to unlock the boot loader for certain releases. You can check if it is possible to unlock the boot loader of your device in the service menu by following the steps below:

In your device, open the dialer and enter

*#*#7378423#*#*

to access the service menu.
Tap Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then you can continue with the next step. If it says No, or if the status is missing, your device cannot be unlocked.

unlock using TA partition

https://forum.xda-developers.com/showthread.php?t=2562649

I have rooted device and did:


~ # fdisk -l /dev/block/mmcblk0
Found valid GPT with protective MBR; using GPT

Disk /dev/block/mmcblk0: 15269888 sectors, 3360M
Logical sector size: 512
Disk identifier (GUID): 98101b32-bbe2-4bf2-a06e-2bb33d000c20
Partition table holds up to 27 entries
First usable sector is 34, last usable sector is 15269854

Number  Start (sector)    End (sector)  Size Name
     1             256            4351 2048K TA
     2            4352            5375  512K sbl1
     3            5376            5887  256K s1sbl
     4            5888            6015 65536 dbi
     5            6016            7039  512K aboot
     6            7040            8063  512K rpm
     7            8064            9087  512K tz
     8            9088           10111  512K alt_sbl1
     9           10112           10623  256K alt_s1sbl
    10           10624           10751 65536 alt_dbi
    11           10752           11775  512K alt_aboot
    12           11776           12799  512K alt_rpm
    13           12800           13823  512K alt_tz
    14           16384           19455 1536K fsg
    15           24576           27647 1536K modemst1
    16           32768           35839 1536K modemst2
    17           40960           73727 16.0M persist
    18           73728          204799 64.0M modem
    19          204800          245759 20.0M boot
    20          245760          266239 10.0M ramdump
    21          266240          299007 16.0M FOTAKernel
    22          299008          299071 32768 DDR
    23          299072          331839 16.0M LTALabel
    24          335872          352255 8192K apps_log
    25          352256         4390911 1972M system
    26         4390912         4800511  200M cache
    27         4800512        15269854 5111M userdata

~ # dd if=/dev/block/mmcblk0p1 of=/sdcard/1.TA bs=1k
2048+0 records in
2048+0 records out
2097152 bytes (2.0MB) copied, 0.187378 seconds, 10.7MB/s

dpavlin@nuc:/nuc/xperia-t3$ adb pull /sdcard/1.TA




yukon

upstream source for android? https://github.com/Sony-Yukon

debug board

https://elinux.org/Sony_Debug_Assist_board

Qualcomm HS-USB Diagnostics 9006 (CMIIW)

https://forum.xda-developers.com/general/help/how-to-enter-qualcomm-mmc-storage-diag-t3253478

nobody knows how to get into it

TWRP

https://forum.xda-developers.com/xperia-t3/development/recovery-sony-xperia-t3-d5103-seagull-t3783962

get root

https://forum.xda-developers.com/xperia-t3/general/root-xperia-t3-version-t3105947

permalink
sigrok

decode cvs i2c

https://www.eevblog.com/forum/testgear/ds1000z-series-serial-decode/msg644787/#msg644787

sigrok-cli.exe -I csv:samplerate=1000000 -i i2cdata.csv -P i2c > i2cdata.txt
permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...