2020-04-10

How to upgrade micronucleus

micromicronucleusnucleus 是 ATtiny/ ATMega328p的bootloder, 它的过人之处是给这些芯片带来usb支持.
使得它们可以直接通过usb口来烧录.
我购买了很多digispark 开发板. 这些开发板小巧方便价格低廉. 非常适合做小项目.
micronucleus 可以直接通过usb口来升级.

首先
git clone git@github.com:micronucleus/micronucleus.git
进入commandline 目录安装micronucleus.exe
make
sudo make install
49-micronucleus.rules 
copy 49-micronucleus.rules from this folder to /etc/udev/rules.d/
 
进入upgrade/releases/ 
micronucleus --run upgrade-t85_default.hex  

如果使用错误的升级文件, 会出现内存不够无法安装的问他.
 micronucleus  --run t85_default.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device has firmware version 2.3
> Device signature: 0x1e930b
> Available space for user applications: 6522 bytes
> Suggested sleep time between sending pages: 7ms
> Whole page count: 102  page size: 64
> Erase function sleep duration: 714ms
parsing: 50% complete
> Program file is 1594 bytes too big for the bootloader!


2020-03-26

micropython 与adxl345 mma845x三轴加速度计

df-robot的 库  https://github.com/DFRobot/micropython-dflib/blob/master/ADXL345/user_lib/ADXL345.py

mma845x库
https://github.com/clmendez/ME-405---MiniProject/blob/148b4769cf0b6f78c22a4bd362eb3987f40393ad/mma845x.py

YXD12864G04 3.8寸液晶屏


这块液晶屏是k0108驱动的并口单色用液晶屏。
VCC 5V供电,IO接口3.3V的esp32 也可以驱动。


U8G2_KS0108_128X64_F u8g2(U8G2_R0, 0,4,16, 17, 5, 18, 23, 19, /*enable=*/21,/*dc=*/  22,   /*cs0=*/ 2, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/  U8X8_PIN_NONE);

2020-03-21

Freeplane Freemind

freemind 是我10年前一个常用的工具软件,因为一次小事故丢失很多资料之后便放弃了。 freeplane 是freemind 的新的积极维护的分支/继承者。 能想到的功能它都有,而且还是熟悉的完善的快捷键。 1. 可以建立一个目录文件,用相对链接到其它文件。 2. 复制网络图片链接后,直接粘帖到本地文件中(图片存储到同名目录)。 3. 丰富的导入导出功能,比如导出到markdown。 4. 自动保存备份很赞,电脑崩溃后重新访问文件,自动提示恢复。 5. 快捷键很赞,而且可以自己修改,真不像一个java软件。

2019-04-13

openwrt: Signature check failed. Remove wrong Signature file.

因为opkg默认采用http下载包,openwrt安装软件包时,如果下载软件列表后出现签名错误,可能是因为里面有某些敏感词。
////////////////////////// 其实是广告过滤软件的锅  关闭广告过滤就行了
解决的方法是,使用https下载。这是一个鸡和蛋的问题。根据路由器型号手工下载下面的包,然后 opkg install <包的名字>。
ca-certificates_20180409-2_all.ipk
libopenssl_1.0.2r-1_mipsel_24kc.ipk
libpcre_8.41-2_mipsel_24kc.ipk
libustream-openssl_2018-07-30-23a3f283-1_mipsel_24kc.ipk
wget_1.19.5-1_mipsel_24kc.ipk

然后在luci--system-software Distribution feeds 里面 把http 都改成https。

src/gz openwrt_core https://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt7621/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony

Downloading https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.

一路通过。



root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt7621/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt7621/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/base/Packages.sig
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/luci/Packages.sig
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/packages/Packages.sig
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/routing/Packages.sig
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony/Packages.sig
Signature check failed.
Remove wrong Signature file.

How to upgrade micronucleus

micro micronucleus nucleus 是 ATtiny/ ATMega328p的bootloder, 它的过人之处是给这些芯片带来usb支持. 使得它们可以直接通过usb口来烧录. 我购买了很多 digispark 开发板. 这些开发板小巧方便价格低廉. ...