2023年9月22日 星期五

STM32 -- 使用 vial 及 vibl

參考網址 


必須使用特製的 st-flash,stlink-stm32f10-opt-bytes,提供 "program option bytes" 的功能。其在燒錄 vibl 後,可將對

From the root of vial-qmk, run python3 util/vial_generate_keyboard_uid.py in order to generate a unique Vial keyboard ID:

-----------------
ajax@stm-dev /work/vial-qmk $ python3 util/vial_generate_keyboard_uid.py 
#define VIAL_KEYBOARD_UID {0xA3, 0xA1, 0xFF, 0x29, 0xE9, 0x28, 0xCC, 0xCC}
-----------------

-----------------
ajax@stm-dev /work $ st-flash opterase
st-flash 1.5.1
2023-09-23T08:19:06 INFO usb.c: -- exit_dfu_mode
2023-09-23T08:19:07 INFO common.c: Loading device parameters....
2023-09-23T08:19:07 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2023-09-23T08:19:07 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2023-09-23T08:19:07 WARN common.c: Unlocking option flash

ajax@stm-dev /work/vibl/bootloader/build $ st-flash write ../../misc/opt-head.bin 0x1FFFF800
st-flash 1.5.1
2023-09-23T08:21:33 INFO common.c: Loading device parameters....
2023-09-23T08:21:33 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2023-09-23T08:21:33 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0 bytes (0 KiB) in pages of 1024 bytes
2023-09-23T08:21:33 WARN common.c: Unlocking option flash

ajax@stm-dev /work/vibl/bootloader/build $ st-flash write bootloader-magic_tpk_68.bin  0x8000000
------------------

使用 STM32 ST-LINK Utility 比較穩定可靠。另外,必須將開發板的 Boot0 切換到 1 (3.3V),ST-LINK Utility 才能連上。Boot0 不接時,會下拉成 0。但是使用 st-flash 則不用管 Boot0 的位置。

使用 ST-LINK Utility 寫入的順序如下。

  • opt-default.bin (size: 0x0010) => 0x1FFFF800
  • opt-head.bin (size: 0x0002)  => 0x1FFFF800
  • bootloader-magic_tpk_68.bin => 0x8000000
  • opt-tail.bin => 0x1FFFF802

在寫入保護之後,假若執行 "Erase Chip",會出現 "Some flash pages are write protected!" 的錯誤。

再次從 0x8000000 寫入資料會顯示如下的資料。

09:28:20 : [bootloader-magic_tpk_68.bin] opened successfully.
09:28:20 : [bootloader-magic_tpk_68.bin] checksum : 0x00043E9E 
09:28:29 : Some flash sectors are write protected.
           The write protection will be disabled then restored after flash programming
           in case there is no option bytes segment within the file.
09:28:29 : Memory programmed in 0s and 343ms.
09:28:29 : Verification...OK

但反覆測試,不太確定正確的該如何做。假如不成功,就試另一種方法吧。


2023年9月18日 星期一

使用 SQL Server 的 BCP, 將 Visual FoxPro 的大量資料匯入到 SQL Server

在微軟尚發行 32位元的 Windows 10 時,可以使用 SQL Server 2008 的匯入功能,配合微軟提供的 VFP odbc driver,將VFP的資料匯入到 SQL Server。但後來微軟只發行 64位元的 Windows OS 後, VFP odbc driver 就無法使用了,必須用其他方法匯入資料。

自己寫程式一筆一筆 insert,是最直接明瞭的方法,但效率非常非常慢。最快的方式是使用微軟提供的 BCP (Bulk Copy Program),經測試,40多萬筆的資料,花費的時間在 10秒以內。

參見 


下面的文章是 VFP 愛用者社區討論中引用的微軟官方文件,但原始文件已下架。可能是使用翻譯軟體轉成中文,有一些不通順的地方,稍微做一些修改。

-------------

這是微軟提供的,看樣子要研究研究一下 bcp,因為還不太了解怎麼用 bcp
http://support.microsoft.com/kb/153199/zh-tw

如何使用 SQL Server 大量複製程式, 從 Visual FoxPro 大量的資料移動到 SQL Server

文章編號 : 153199
上次校閱 : 2007年2月12日
版次 : 4.1

結論

本文告訴您如何使用大量複製程式 (BCP),Microsoft SQL Server 隨附的獨立公用程式。 如果您必須同時移動大量的資料至 SQL Server, 使用 Microsoft Visual FoxPro 「 SQL 轉換精靈 」 可能會太慢。 Bulk Copy Program 公用程式只能傳送資料, 它不會建立資料表。 您可以使用 「 SQL 轉換精靈 」 來建立資料表,或您自己用 ISQL / W 建立。 為了要讓 SQL 伺服器接受 (Accept) 使用 「 快速 」 版本的 BCP 資料,您必須執行 sp_dboption 系統預存程序將 select into / bulkcopy 選項設為 True


逐步說明範例

以下的範例步驟,使用 BCP 公用程式將資料從一個 ASCII 檔案傳送至 SQL Server:

1. 從 SQL Server 執行:
sp_dboption Mydatabase,bulkcopy,true

2. 從 Visual FoxPro 資料表建立使用定位點 (TAB) 分隔的 ASCII 檔案。 舉例來說,請使用低階的常式,以輸出到文字檔的欄位:
=FPUTS(fhandle, emp_id + CHR(9) + ;
  last_name + CHR(9) + ;
  first_name + CHR(9) + ;
  title + CHR(9) + ;
  PADR(DTOC(birth_date)+' '+'12:00AM',16,' ') + CHR(9) + ;
  PADR(DTOC(hire_date)+' '+ '12:00AM',16,' ') + CHR(9) + ;
  address + CHR(9) + ;
  city + CHR(9) + ;
  region + CHR(9) + ;
  postalcode + CHR(9) + ;
  STR(salary,12,2) )


3. 建立 bcp 格式檔案才能傳送資料。 例如, 從 SQL Server 下 bin 目錄:
bcp mydatabase.dbo.employee out c:\temp\emp.txt /Sservename /Usa /Ppassword
注意: 這個命令應該是在同一行。

4. 請遵循提示, 和型別 \t 如為每個欄位欄位終端子。

5. 出現提示時, 使用有意義的名稱, 例如 employee.fmt 儲存格式檔案。

6. 使用 MS - DOS 編輯器來編輯  .fmt 檔。

7. 在下列範例使用 employee.fmt 為變更為每個資料列第二欄為 SYBCHAR:
6.0
11
1 SYBCHAR 0 6 "\t" 1 emp_id
2 SYBCHAR 0 20 "\t" 2 last_name
3 SYBCHAR 0 10 "\t" 3 first_name
4 SYBCHAR 0 30 "\t" 4 title
5 SYBCHAR 0 16 "\t" 5 birth_date
6 SYBCHAR 0 16 "\t" 6 hire_date
7 SYBCHAR 0 60 "\t" 7 address
8 SYBCHAR 0 15 "\t" 8 city
9 SYBCHAR 0 15 "\t" 9 region
10 SYBCHAR 0 10 "\t" 10 postalcode
11 SYBCHAR 0 8 "\r\n" 11 salary

8. 檔案結尾 (EOF) 標記為變更第五資料行中的最後一列為 "\r\n"。

9. 將 ASCII 檔案傳輸至 SQL Server 使用 BCP 如下所示:
bcp mydatabase.dbo.employee in c:\temp\employ.txt /f employee.fmt /S servernamec /Usa /P"pwd"

10. 回為使用步驟 1 以 FALSE 參數 FALSE, 完成時設定 Bulkcopy 選項。

另請參閱

如需詳細資訊, 請參閱 SQL Server Administrator ' s 系統 Guide。

--------------------------------------------------------------------------------
這篇文章中的資訊適用於:
• Microsoft Visual FoxPro 3.0 Standard Edition
• Microsoft Visual FoxPro 3.0b Standard Edition
• Microsoft Visual FoxPro 6.0 Professional Edition
• Microsoft Visual FoxPro 7.0 Professional Edition
• Microsoft Visual FoxPro 8.0 Professional Edition
• Microsoft Visual FoxPro 9.0 Professional Edition

關鍵字: kb3rdparty kbhowto kbinterop KB153199 KbMtzh kbmt

--------------------------------------------------------------------------------

需下載並安裝 sqlcmd,才能執行 bcp

--------
C:\temp>bcp [rtcourse-tst].[caucgi].[dept2] out "c:\temp\tst.txt" -c -t  -S localhost -U agee
密碼:
開始複製...
已複製 357 個資料列。
網路封包大小 (位元組): 4096
時間 (毫秒) 總計     : 1      平均 : (每秒 357000.00 資料列)
C:\temp>bcp [rtcourse-tst].[caucgi].[dept2] format nul -c -f "c:\temp\tst.fmt" -c -t  -S localhost -U agee
警告: -c 覆寫 -c。
密碼:
--------------


2023年9月10日 星期日

klipper - 多色列印

參考 Prusaslicer 的 Color change。可以在要換顏色的層手動插入 G-code M600。 對應 M600 macro 要做的事,暫停列印,退出 filament,發出 "嗶" 聲。等換好線後,載入 filament,然後按恢復列印。

Klipper 的 macro 可以參考 klipper/config/sample-macros.cfg,將對應 M600 的段落擷取如下

------------------------------------------------
######################################################################
# Filament Change
######################################################################

# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 50mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "RESUME" gcode.

[pause_resume]

[gcode_macro M600]
gcode:
    {% set X = params.X|default(50)|float %}
    {% set Y = params.Y|default(0)|float %}
    {% set Z = params.Z|default(10)|float %}
    SAVE_GCODE_STATE NAME=M600_state
    PAUSE
    G91
    G1 E-.8 F2700
    G1 Z{Z}
    G90
    G1 X{X} Y{Y} F3000
    G91
    G1 E-50 F1000
    RESTORE_GCODE_STATE NAME=M600_state
----------------
--------------------------------

G90 - Absolute Mode;G91 - Relative Mode

G0, G1 - Linear Move

G1 [E<pos>] [F<rate>] [X<pos>] [Y<pos>] [Z<pos>]






2023年8月11日 星期五

Arch Linux - 透過 Flatpak 使用 Application

 ArchLinux

-------
正在解決依賴關係…
:: 有 7 個提供者可供 xdg-desktop-portal-impl:
:: 軟體庫 extra
   1) xdg-desktop-portal-gnome  2) xdg-desktop-portal-gtk
   3) xdg-desktop-portal-hyprland  4) xdg-desktop-portal-kde  5) xdg-desktop-portal-lxqt
   6) xdg-desktop-portal-wlr  7) xdg-desktop-portal-xapp
--------

安裝 com.prusa3d.PrusaSlicer 後,執行時會出錯。

----------------
$ flatpak run com.prusa3d.PrusaSlicer
sh: warning: setlocale: LC_ALL: cannot change locale (zh_TW.UTF-8)
--------------------------------------------------------------------------
Message: 23:26:30: Starting PrusaSlicer flatpak with entrypoint script
--------------------------------------------------------------------------
/app/bin/entrypoint: line 12: warning: setlocale: LC_ALL: cannot change locale (zh_TW.UTF-8)
Message: 23:26:30: WARN: Executing prusa-slicer with locale workaround zh_TW.UTF-8
[ajax@aj-arch-pc ~]$ [2023-08-11 23:26:30.470612] [0x00007f30355fed40] [trace]   Initializing StaticPrintConfigs
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.

locale::facet::_S_create_c_locale name not valid
---------------

使用 sh 進去看

------------------
$ flatpak run  --command=sh com.prusa3d.PrusaSlicer
sh: warning: setlocale: LC_ALL: cannot change locale (zh_TW.UTF-8)
[com.prusa3d.PrusaSlicer ~]$ 
....
[com.prusa3d.PrusaSlicer ~]$ ls -l /usr/lib/locale/zh_TW.utf8
lrwxrwxrwx 1 nfsnobody nfsnobody 44 Aug 11 21:26 /usr/lib/locale/zh_TW.utf8 -> ../../share/runtime/locale/zh/lib/zh_TW.utf8
[com.prusa3d.PrusaSlicer ~]$ ls /usr/lib/locale/../../share/runtime/locale/
(此目錄 /usr/share/runtime/locale/ 是空的)
------------------


2023年8月10日 星期四

頭燈改 18650 鋰電池

在蝦皮買的淘寶貨,一口氣買了好幾個,一個不到台幣50元。

最開始是買一個來用用看,覺得蠻輕巧方便的,缺點是裡面的電池實在太小,使用時間好短,充飽後用不到一個小時就沒電。還好,它的體積夠大,直徑剛好夠塞進 18650 的鋰電池。剛好手邊有一堆便宜的18650電池,就試著改改看,想説便宜,失敗就算了,比較不會心疼。不過,後來因為它裡面的紅線接電池負極,黑線接電池正極,害我很直覺的把紅線焊正極,黑線焊負極,把電路板燒壞了,還是心疼了一晚。

把內部卡到的隔板切除,剛剛好把 18650 電池塞進去,只是電池稍長一點。把沒電路板的一端挖通,再用3D印表機印一個延伸蓋,用烙鐵焊起來。改裝後,使用時間變得長很多,生活中很好用,因此一口氣又再買好幾個來改,可以到處放一個,隨時可用。

買到的充電頭燈,輕便亮度夠,有聚光和不聚光兩種模式。目前能找到最便宜的,一個不到新台幣 40元。

拆開後,內部構造很簡單,兩個 LED燈,一塊小電路板。半導體技術進步好快,很多小裝置都是一個小小的 IC 就解決了,價錢也很便宜。


電池的大小比一比,如下圖。

塞進 18650 電池後,一端凸出一點,用3D印一個蓋子,再用烙鐵焊接在一起。

完成後的成品如下,看起來不太違和,使用時間也變得長很多。


延伸蓋使用 openscad 描述,內容如下

------------------
fn=32;
ex_h = 4.5;
ex_d = 19.5;
thk = 3;

module cap_body() {
    difference() {
        cylinder(d=ex_d+thk*2, h=ex_h+thk, $fn=fn*2);
        translate([0, 0, -1]) cylinder(d=ex_d, h=ex_h+1, $fn=fn*2);
    }
}

module cyl_fillet() {
    difference() {
        cylinder(d=ex_d+10, h=ex_h+10, $fn=fn*2);
        translate([0, 0, -2]) cylinder(d1=ex_d+15, d2=6, h=ex_d+5, $fn=fn*2);
    }
}

difference() {
    cap_body();
    cyl_fillet();
}
---------------------

換下來的 14500 鋰電池,大小和 3號電池一樣,遙控器沒電就順手拿來代用。一顆鋰電池取代兩顆乾電池,其中一個空槽就用電線短路。








2023年7月19日 星期三

Linux - 透過 Flatpak 使用 Application

Gentoo,參考 https://wiki.gentoo.org/wiki/Flatpak,ArchLinux,也差不多。系統更新後,flatpak 也要 update,不然有的程式,如 PrusaSlicer 會怪怪的。

按照 Wiki 的說明安裝完成,重新開機後,試著安裝和執行 Package。

----------------

$ flatpak update
正在尋找更新...

無事可做。
$ gsettings get org.gnome.desktop.interface gtk-theme
'HighContrast'

$ flatpak install flathub org.gtk.Gtk3theme.HighContrast
正在尋找符合項目…
錯誤: No remote refs found for ‘flathub’

$  flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

$ flatpak install flathub org.gtk.Gtk3theme.HighContrast正在尋找符合項目…
錯誤: flathub 遠端沒有項目符合 org.gtk.Gtk3theme.HighContrast

$ flatpak install flathub com.prusa3d.PrusaSlicer
正在尋找符合項目…
com.prusa3d.PrusaSlicer/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/21.08) 所要求的執行時期環境在 flathub 遠端中有找到
您想要安裝嗎? [Y/n]: 

com.prusa3d.PrusaSlicer permissions:
    ipc               network          x11                devices
    file access [1]   dbus access [2]  bus ownership [3]  system dbus access [4]

    [1] /media, /run/media, home, xdg-run/gvfs
    [2] com.prusa3d.prusaslicer.InstanceCheck.*,
        org.freedesktop.DBus.Introspectable.*
    [3] com.prusa3d.prusaslicer.*
    [4] org.freedesktop.UDisks2


        ID                                            分支   Op 遠端    下載
 1. [✓] com.prusa3d.PrusaSlicer.Locale                stable i  flathub  10.6 MB / 10.6 MB
 2. [✓] org.freedesktop.Platform.GL.default           21.08  i  flathub 129.6 MB / 129.8 MB
 3. [✓] org.freedesktop.Platform.GL.nvidia-525-125-06 1.4    i  flathub 415.2 MB / 415.2 MB
 4. [✓] org.freedesktop.Platform.Locale               21.08  i  flathub 144.0 MB / 326.8 MB
 5. [✓] org.freedesktop.Platform.VAAPI.Intel          21.08  i  flathub  11.8 MB / 11.9 MB
 6. [✓] org.freedesktop.Platform.openh264             2.0    i  flathub   1.5 MB / 1.5 MB
 7. [✓] org.freedesktop.Platform                      21.08  i  flathub 155.8 MB / 202.3 MB
 8. [✓] com.prusa3d.PrusaSlicer                       stable i  flathub  67.5 MB / 68.5 MB

安裝完成。

$ flatpak run com.prusa3d.PrusaSlicer
--------------------------------------------------------------------------
Message: 10:29:15: Starting PrusaSlicer flatpak with entrypoint script
--------------------------------------------------------------------------

$ [2023-07-20 10:29:15.408172] [0x00007f7f4c22dd40] [trace]   Initializing StaticPrintConfigs
Gtk-Message: 10:29:15.416: Failed to load module "canberra-gtk-module"
[2023-07-20 10:29:17.494827] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Zonestar.idx when loading bundle Zonestar. Going to search for it in cache folder.
[2023-07-20 10:29:17.498202] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/BIBO.idx when loading bundle BIBO. Going to search for it in cache folder.
[2023-07-20 10:29:17.503602] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Snapmaker.idx when loading bundle Snapmaker. Going to search for it in cache folder.
[2023-07-20 10:29:17.506831] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Trimaker.idx when loading bundle Trimaker. Going to search for it in cache folder.
[2023-07-20 10:29:17.509011] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Anker.idx when loading bundle Anker. Going to search for it in cache folder.
[2023-07-20 10:29:17.510935] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/RatRig.idx when loading bundle RatRig. Going to search for it in cache folder.
[2023-07-20 10:29:17.514338] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/MakerGear.idx when loading bundle MakerGear. Going to search for it in cache folder.
[2023-07-20 10:29:17.524208] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Artillery.idx when loading bundle Artillery. Going to search for it in cache folder.
[2023-07-20 10:29:17.528303] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Voron.idx when loading bundle Voron. Going to search for it in cache folder.
[2023-07-20 10:29:17.564913] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Templates.idx when loading bundle Templates. Going to search for it in cache folder.
[2023-07-20 10:29:17.579916] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/gCreate.idx when loading bundle gCreate. Going to search for it in cache folder.
[2023-07-20 10:29:17.586573] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Print4Taste.idx when loading bundle Print4Taste. Going to search for it in cache folder.
[2023-07-20 10:29:17.587819] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Elegoo.idx when loading bundle Elegoo. Going to search for it in cache folder.
[2023-07-20 10:29:17.591829] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/TriLAB.idx when loading bundle TriLAB. Going to search for it in cache folder.
[2023-07-20 10:29:17.605191] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Ultimaker.idx when loading bundle Ultimaker. Going to search for it in cache folder.
[2023-07-20 10:29:17.607750] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Geeetech.idx when loading bundle Geeetech. Going to search for it in cache folder.
[2023-07-20 10:29:17.631185] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Creality.idx when loading bundle Creality. Going to search for it in cache folder.
[2023-07-20 10:29:17.667837] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Rigid3D.idx when loading bundle Rigid3D. Going to search for it in cache folder.
[2023-07-20 10:29:17.672664] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Anycubic.idx when loading bundle Anycubic. Going to search for it in cache folder.
[2023-07-20 10:29:17.687543] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/BIQU.idx when loading bundle BIQU. Going to search for it in cache folder.
[2023-07-20 10:29:17.690856] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/INAT.idx when loading bundle INAT. Going to search for it in cache folder.
[2023-07-20 10:29:17.695248] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Jubilee.idx when loading bundle Jubilee. Going to search for it in cache folder.
[2023-07-20 10:29:17.697763] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Infinity3D.idx when loading bundle Infinity3D. Going to search for it in cache folder.
[2023-07-20 10:29:17.702944] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/LulzBot.idx when loading bundle LulzBot. Going to search for it in cache folder.
[2023-07-20 10:29:17.704932] [0x00007f7f4c22dd40] [error]   Missing index /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/FLSun.idx when loading bundle FLSun. Going to search for it in cache folder.

(prusa-slicer:8): Gtk-WARNING **: 10:29:18.334: Negative content width -8 (allocation 10, extents 9x9) while allocating gadget (node entry, owner GtkEntry)

(prusa-slicer:8): Gtk-WARNING **: 10:29:18.334: Negative content width -8 (allocation 10, extents 9x9) while allocating gadget (node entry, owner GtkEntry)

(prusa-slicer:8): Gtk-CRITICAL **: 10:29:18.379: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(prusa-slicer:8): Gtk-WARNING **: 10:29:18.390: Negative content width -8 (allocation 10, extents 9x9) while allocating gadget (node entry, owner GtkEntry)

(prusa-slicer:8): Gtk-WARNING **: 10:29:18.390: Negative content width -8 (allocation 10, extents 9x9) while allocating gadget (node entry, owner GtkEntry)

** (prusa-slicer:8): WARNING **: 10:29:41.583: atk-bridge: get_device_events_reply: unknown signature
sh: 列 1: xdg-mime:指令找不到
[2023-07-20 10:29:45.510275] [0x00007f7f4c22dd40] [error]   Couldn't locate idx file /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/PrusaResearch.idx when performing updates.
[2023-07-20 10:29:45.510724] [0x00007f7f4c22dd40] [error]   Couldn't locate idx file /home/ajax/.var/app/com.prusa3d.PrusaSlicer/config/PrusaSlicer/cache/vendor/Templates.idx when performing updates.
-----------------

執行結果如下圖。

執行效果比使用 AppImage 好一些,會安裝相關的檔案,不用自己亂試少了什,或有什麼不相容的。原在在 Xfce 下執行 gtk3 的 Prusa Slicer 的 AppImage,半透明部分會整個透空,無法使用。如下圖,畫面整個亂掉。


-------------------
$ flatpak install flathub com.microsoft.Edge
正在尋找符合項目…
com.microsoft.Edge/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/22.08) 所要求的執行時期環境在 flathub 遠端中有找到
您想要安裝嗎? [Y/n]: 

com.microsoft.Edge permissions:
    ipc             network         cups              pcsc
    pulseaudio      wayland         x11               devices
    file access [1] dbus access [2] bus ownership [3] system dbus access [4]
    tags [5]

    [1] /run/.heim_org.h5l.kcm-socket, host-etc, xdg-desktop, xdg-documents,
        xdg-download, xdg-music, xdg-run/pipewire-0, xdg-videos,
        ~/.local/share/applications:create, ~/.local/share/icons:create
    [2] com.canonical.AppMenu.Registrar, org.freedesktop.FileManager1,
        org.freedesktop.Notifications, org.freedesktop.ScreenSaver,
        org.freedesktop.secrets, org.gnome.Mutter.IdleMonitor.*,
        org.gnome.SessionManager, org.kde.kwalletd5
    [3] org.mpris.MediaPlayer2.edge.*
    [4] org.freedesktop.Avahi, org.freedesktop.UPower
    [5] proprietary


        ID                                        分支            Op     遠端        下載
 1. [✓] org.freedesktop.Platform.GL.default       22.08           i      flathub     142.9 MB / 143.1 MB
 2. [✓] org.freedesktop.Platform.GL.default       22.08-extra     i      flathub      16.2 MB / 143.1 MB
 3. [✓] org.freedesktop.Platform.Locale           22.08           i      flathub      38.2 MB / 333.4 MB
 4. [✓] org.freedesktop.Platform.VAAPI.Intel      22.08           i      flathub      13.3 MB / 13.4 MB
 5. [✓] org.freedesktop.Platform.openh264         2.2.0           i      flathub     887.2 kB / 944.3 kB
 6. [✓] org.freedesktop.Platform                  22.08           i      flathub     156.3 MB / 214.4 MB
 7. [✓] com.microsoft.Edge                        stable          i      flathub     154.8 MB / 153.9 MB

安裝完成。
-------------------

在 Visual Studio Code 啟動 OpenSCAD

要預覽 scad 檔,無法啟動 flatpak 下的 openscad,必須另建一個 shell 檔,openscad_flatpak.sh

--------------
#!/bin/bash
flatpak run org.openscad.OpenSCAD "$@"
--------------

另外,flatpak 的沙箱機制,程式無法讀到其他根目錄下的檔案,必須特別授權。

例如在 openscad 要開啟 /home2 目錄下的檔,會出錯

---------
Failed to open file /home2/ajax/3d-print/ikea_leg_stable.scad: No such file or directory
---------

要針對 home2 執行下列指令

---------
flatpak override --user org.openscad.OpenSCAD --filesystem=/home2
---------

可安裝 Flatseal 來管理

--------
flatpak install com.github.tchx84.Flatseal
---------

中文輸入,倉頡輸入法

https://forum.gamer.com.tw/C.php?bsn=60599&snA=45335







2023年7月4日 星期二

風櫃嘴-陽金公路一日行

 200811062031

同事與我單車環島將屆周年,在這一年內,南征北討,騎過南橫、中橫、北橫,偏偏北部單車聖地--風櫃嘴沒有騎過。因此找了個休假相約去騎。

風櫃嘴是外雙溪到萬里的萬溪路的最高點,路上的標示牌是 "風櫃口"。

與騎過的各種路線相較,風櫃嘴的坡度並非特別難,只有其中幾段比較陡些。

不過自己與同事的實力差別太大,同事約40分鐘騎到,我則多花了一倍的時間。雖然不是假日,來騎車的人不多,可是來的都是高手,在路上,被好媿位騎公路車的超過,就看他們一直猛踩,一下子背影就不見了。

在風櫃嘴喝杯咖啡,促進經濟消費。然後下到萬里,在野柳路上照幾張相片,再到金山吃中飯。

吃完中飯,上陽金公路,在路邊的公車亭喝個飯後冷飲,再小睡一番。
睡飽上路,就請同事先走,不要等我,直接回家。這樣我可以慢慢騎,彼此沒有壓力。
上了陽明山後,因雲氣甚多,整個路都被霧籠罩,視野僅數公尺,看不到漂亮風景,實在可惜。

爬坡爬了好久,到最高點,已超過五點,將要天黑。

回到家 (萬隆),是晚上七點,離早上七點出發,滿十二個小時,里程近100公里。

網誌存檔