远程引脚期不再运行。感谢大家测试远程Pinetime!
Remote PineTime是新加坡的Pinetime智能手表,该手表配置为允许世界上的任何人远程闪烁和测试固件。
远程Pinetime机器人(在Rust中创建)观看一个电报组,用于闪烁命令,并将固件刷新到PineTime。
PINETIME上的显示器已直播到YouTube,因此您可以在我的PineTime上观看现场直播的固件。
要刷新自己的固件并测试PineTime,请加入“远程Pinetime”电报组:https://t.me/remotepinetime
闪烁的日志(来自OpenOCD)和调试消息日志(来自ARM SEMIHOSTING)将在“远程Pinetime Log”电报频道中显示:https://t.me/remotepinetimelog
在YouTube上观看演示视频
要闪烁固件二进制文件https://.../firmware.bin到pinetime在地址0x0 ...
/flash 0x0 https://.../firmware.bin
这适用于未登录保护的任何URL。
不要通过GitHub Actions创建的工件传递URL。他们需要登录,电报机器人将被阻止。
取而代之的是,在“释放”下复制工件并将其上传,该“版本”不受登录保护。
PINETIME固件的某些口味需要引导加载程序,例如McUboot或SoftDevice。首先将引导程序刷新到地址0x0 ,然后刷新固件。
应刷新与McUboot兼容的固件地址0x8000
要在PineTime上进行闪光突破...
/flash 0x0 http://tt-392.space/breakout.hex
Pinetime中突破的演示视频
要闪烁手绘手表脸...
/flash 0x0 https://github.com/lupyuen/pinetime-rust-mynewt/releases/download/v5.0.4/mynewt.elf.bin
/flash 0x8000 https://github.com/lupyuen/pinetime-rust-mynewt/releases/download/v7.0.1/my_sensor_app.img
有关手绘手表脸的更多信息
闪烁一个永不入睡的修改后的“吹”的无限固件...
/flash 0x0 https://github.com/lupyuen/pinetime-rust-mynewt/releases/download/v5.0.4/mynewt.elf.bin
/flash 0x8000 https://github.com/AntonMadness/Pinetime/releases/download/v0.1.1/pinetime-mcuboot-app-img.bin
通过编辑src/DisplayApp/DisplayApp.cpp来修改这一点,以删除对case Messages::GoToSleep:
在Mynewt固件上闪烁生锈,以排放半i的调试消息...
/flash 0x0 https://github.com/lupyuen/pinetime-rust-mynewt/releases/download/v5.0.4/mynewt.elf.bin
/flash 0x8000 https://github.com/lupyuen/pinetime-rust-mynewt/releases/download/v5.0.7/my_sensor_app.img
在骚乱上闪烁生锈...
/flash 0x0 https://github.com/lupyuen/pinetime-rust-riot/releases/download/v1.0.3/PineTime.bin
闪烁McUboot Bootloader 5.0.4 ...
/flash 0x0 https://github.com/lupyuen/pinetime-rust-mynewt/releases/download/v5.0.4/mynewt.elf.bin
有时,由于固件错误,PineTime会被锁定。刷新上述McUboot布洛弹器应修复锁定。
要在网络浏览器(不安装任何IDE或工具链)中构建自己的固件,请查看文章...
用github动作在云中构建Pinetime固件
使用WebAssembly的Web浏览器中的PineTime手表面
电报中闪烁的外观...
在YouTube上观看演示视频
在PineTime上有问题吗?与矩阵 / Discord / Telegram / irc上的Pinetime社区聊天...
https://wiki.pine64.org/index.php/pinetime#community
查看我的Pinetime文章
因为在大流行期间,在世界范围内运输真正的硬件是困难且昂贵的……并且远程固件测试可能是解决方案。
创建远程PinEtime的目的是允许人们学习和尝试智能手表编码而无需真正的智能手表。
查看我的视频演示...
Riot Summit 2020-更安全,更简单的嵌入式程序,带有Rust Riot
ARM SEMIHOSTING使我们的固件通过调用ARM Cortex-M指令bkpt来发出调试消息。
查看此实现此pinetime-rust-mynewt的ARM半旋转的实现...
/// Send an ARM Semihosting command to the debugger, e.g. to print a message.
/// To see the message you need to run opencd:
/// openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -f scripts/debug.ocd
static int __semihost ( int command , void * message ) {
// Warning: This code will trigger a breakpoint and hang unless a debugger is connected.
// That's how ARM Semihosting sends a command to the debugger to print a message.
// This code MUST be disabled on production devices.
__asm(
"mov r0, %[cmd] n"
"mov r1, %[msg] n"
"bkpt #0xAB n"
: // Output operand list: (nothing)
: // Input operand list:
[ cmd ] "r" ( command ),
[ msg ] "r" ( message )
: // Clobbered register list:
"r0" , "r1" , "memory"
);
return 0 ;
}我们称__semihost()为So: semihosting_console.c
/// ARM Semihosting Command
#define SYS_WRITE (0x5)
/// Write "length" number of bytes from "buffer" to the debugger's file handle fh.
/// We set fh=2 to write to the debugger's stderr output.
static int semihost_write ( uint32_t fh , const unsigned char * buffer , unsigned int length ) {
// If debugger is not connected, quit.
if (! debugger_connected ()) { return 0 ; }
if ( length == 0 ) { return 0 ; }
uint32_t args [ 3 ];
args [ 0 ] = ( uint32_t ) fh ;
args [ 1 ] = ( uint32_t ) buffer ;
args [ 2 ] = ( uint32_t ) length ;
return __semihost ( SYS_WRITE , args );
}
/// Return non-zero if debugger is connected. From repos/apache-mynewt-core/hw/mcu/ambiq/apollo2/src/hal_system.c
static int debugger_connected ( void ) {
return CoreDebug -> DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk ;
}当我们打电话...
/// Write "hellon" (6 characters) to the debugger's stderr output.
#define SEMIHOST_HANDLE 2
semihost_write ( SEMIHOST_HANDLE , ( const unsigned char * ) "hellon" , 6 );我们将看到消息hello出现在OpenOCD和Remote PineTime日志中。 (消息必须以新线结尾,否则不会出现)
需要在OpenOCD中启用ARM半旋转。这是远程PINETIME启用ARM半旋转的方式: flash-log.ocd
# Arm Semihosting is used to show debug console output and may only be enabled after the init event.
# We wait for the event and enable Arm Semihosting.
$_TARGETNAME configure -event reset-init {
echo "Enabled ARM Semihosting to show debug output"
arm semihosting enable
}
ARM半iPhost的速度可能很慢...整个微控制器冻结,而调试消息则通过字符通过SWD端口传输到OpenOCD。
我们建议使用静态阵列在内存中缓冲传出消息。
在ARM半播的pinetime-rust-mynewt实现中,我们使用MyNewt MBUFS有效地缓冲消息。
当蓝牙LE处理正在进行时,请勿使用ARM半直静止...将删除消息,并且蓝牙LE客户端将自动断开连接。
ARM半直螺旋应在生产固件中被禁用。另外,当连接JLINK调试器时,ARM半轴向可能会悬挂。对于pinetime-rust-mynewt我们在targets/nrf52_boot/pkg.yml中使用GCC FLAG -DDISABLE_SEMIHOSTING禁用ARM半轴,(用于McUboot Bootloader)和targets/nrf52_my_sensor/pkg.yml (用于应用程序固件)。
创建自己的电报机器人...
与Botfather聊天,创建一个名为PineTime Bot的机器人
输入/mybots ,选择PineTime Bot
选择Edit Commands ,输入flash - flash 0x0 https://.../firmware.bin
要运行自己的电报机器人:克隆此仓库,然后在shell脚本中运行此回购...
# Set your Telegram Bot Token
export TELEGRAM_BOT_TOKEN= ???
# This is needed to fix the h2 / indexmap build error "ids: IndexMap<StreamId, SlabIndex> expected 3 type arguments"
export CARGO_FEATURE_STD=1
# Show Rust stack trace
export RUST_BACKTRACE=1
cd ~ /remote-pinetime-bot
for (( ; ; ))
do
git pull
pkill openocd
cargo run
echo " ---------ERROR-------- "
sleep 30
doneTelegram Bot将Pinetime Updater和XPACK OpenOCD调用闪光固件通过SWD将其命名为PineTime。
要下载Xpack OpenOCD(用于Mac)或OpenOCD SPI(对于Raspberry Pi),请查看pinetime-updater/run.sh
Telegram Bot当前使用Xpack OpenOCD(而不是OpenOCD SPI)在Raspberry Pi上运行。从这里下载了32位Raspbian的Xpack OpenOCD
ST-Link的USB驱动程序像SO一样在Raspbian上配置
# For Linux Only: Install UDEV Rules according to https://xpack.github.io/openocd/install/#udev
sudo cp xpack-openocd/contrib/60-openocd.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules要实时将Raspberry Pi摄像机流式传输到YouTube:在外壳脚本中运行此摄像机...
for (( ; ; ))
do
raspivid -n -o - -t 0 -vf -hf -fps 30 -b 6000000 |
ffmpeg -re -ar 44100 -ac 2
-acodec pcm_s16le -f s16le -ac 2
-i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental
-f flv rtmp://a.rtmp.youtube.com/live2/YOUR_YOUTUBE_STREAM_KEY
sleep 1
done基于https://www.makeuseof.com/tag/live-stream-youtube-raspberry-pi/
使用有线网络连接而不是wifi ...因为打开微波炉会破坏2.4 GHz WiFi网络并终止您的YouTube Live流。 (并且您的YouTube直播网址将改变)
这是带有(从左到右)Raspberry Pi 4,Raspberry Pi V2摄像头模块(8 MP)的实时流式设置,两个放大镜,带有Pogo Pin(尖端)和ST-Link V2的PineTime,Pintime Etiment
盖上一个纸质的围墙,以阻止放大镜上的反射(如望远镜)...
如何制作纸质的围栏...
放置覆盆子PI,摄像头模块,两个放大镜和PineTime
通过在Raspberry Pi,相机模块和放大镜上放置一个信封来建立脚手架
通过放置一块A4大小的纸来完成脚手架
在脚手架上粘贴纸巾条,请务必覆盖Raspbery Pi。我通过将半杯与半杯水混合在一起来创建糊状物。
让Papier-mâché干燥过夜,形成外壳的形状。用剪刀修剪纸纸。微波纸纸将其干燥。
以有序的方式粘贴第二层纸巾条。
微波纸纸一分钟,让它冷却。使用倾覆的碗来支撑结构。重复3次,直到纸纸干燥为止。
用剪刀修剪纸纸围栏。
是否有任何安全问题将电报机器人曝光到世界上进行闪烁和测试?
我们尽可能减轻安全风险...
我们的电报机器人是使用Rust(一种安全的系统编程语言)构建的。
在src/main.rs上查看Rust源代码
不允许远程访问主机。电报机器人仅针对/flash命令进行轮询并执行它们。
临时文件将在tempfile库使用后自动删除。因此,我们通过恶意软件减少文件的暴露。
但是有一个问题...我们的PineTime可能会闪烁着攻击附近其他蓝牙设备的恶意软件。
为了物联网教育...我允许它! :-)
我完全意识到当我经营这项免费服务时会有风险。而且,如果您选择操作自己的远程PineTime,则也应该知道风险。
关于半座支持的一个严重的安全问题:半旋律的API支持在OpenOCD主机(Raspberry PI)上阅读,写作和执行文件。
这个安全问题尚未解决。解决方法是禁用OpenOCD中的半host支持,这也将禁用调试消息。
将半台化调试日志写入单独的电报频道
油门将登录到电报频道的半iHosting消息的数量(汇总和将消息传输为单个电报请求每5秒钟)
允许半台化的调试日志和固件闪烁以共存(它们都使用OpenOCD)