쉘 스크립트를 실행을 했는데, “bad interpreter: /bin/bash^M: no such file or directory”이런 메시지가 나오면 dos2unix를 실행한다.
$ brew install dos2unix
$dos2unix ./build_all.sh
$./build_all.sh
쉘 스크립트를 실행을 했는데, “bad interpreter: /bin/bash^M: no such file or directory”이런 메시지가 나오면 dos2unix를 실행한다.
$ brew install dos2unix
$dos2unix ./build_all.sh
$./build_all.sh
Adafruit사의 Feather m0 bluefruit 보드의 UART to BLE Throughput 측정. PC측에는 nRF Connect 앱인 BLE 앱을 사용함.
이 앱에서 연결을 하고 데이터를 수신한다. 보내는 측의 로그를 확인하면 대략 4.71KB/S 정도 나오는데, 핸드폰 앱에서 확인해보니 4KB/S 정도 나옴.
성능도 중요하지만 무선이므로 데이터 손실이 없을 수 없으며, 찾아보니 그 이유중 하나는 다음과 같다. (출처 – https://interrupt.memfault.com/blog/ble-throughput-primer)
Counterintuitively, even though the Link Layer of BLE is reliable, packet loss is still something to be concerned about for BLE. This is because many many stacks drop data within the software stack. For example, BLE messages get queued up in the stack and when the heap holding the packets runs out of memory, some stacks will silently drop data. This means if you are sending large amounts of data over BLE you will usually want to add some sort of reliability layer that can detect & retransmit messages when data is dropped. The way this is implemented can have sizeable impacts on throughput. For example, if you have designed your own protocol on top of L2CAP or GATT and every message sent requires an acknowledgement before another message is sent, you’ll typically wind up adding a connection interval worth of latency getting the data sent out, effectively halving the max throughput which can be achieved.
즉 BLE Link Layer는 reliable하지만 BLE stack에서 힙의 메모리가 부족할 때 일부 스택은 자동으로 데이터를 삭제된다. 따라서 상위레벨의 프로토콜에서 재전송 기법을 사용해야 함.
Mitigation of Data Packet Loss in Bluetooth Low Energy-Based Wearable Healthcare Ecosystem 이 문서의 내용 참고
RX Sensitivity
– 수신기가 감지할 수 있는 최소 신호 강도를 측정한 것. 즉 식별이 가능하고, 처리할 수 있는 가장 약한 신호를 알려준다.
– RX Sensitivity는 dBm으로 표시
– 신호의 미약한 정도를 나타내므로 신호의 전력 레벨이 낮을수록 좋다.
– 예를 들어 -90dBm의 수신기 감도는 -80dBm보다 낫다. 즉, -90dBm 수신기가 더 민감하고 더 낮은 전력 신호를 해석할 수 있음을 의미한다.
Receiver Sensitivity Requirements for modules:
– LoRa: up to -130 dBm
– Cellular: up to -120 dBm
– Bluetooth: -70 dBm to -100 dBm
– ZigBee: -85 to -92 dBm
– Wi-Fi: -40 dBm to -80 dBm
TX Power
TX Power는 worst-case에서도 적어도 이 정도의 전송 전력을 보장한다는 수치이다.
노르딕에서 제공하는 예제코드의 경우 SDK 설정이 sdk_config.h에서 이루어 진다. 문제는 이 파일의 사이즈가 크고 #ifdef 등으로 설정이 되어 있어서 파일 자체를 보기가 불편하다. 그래서 이 설정을 쉽게 하는 툴이 제공이 되는데, 기본 SES 설정에는 없어서 따로 설정을 해야 한다.
다음의 코드를 삽입한다
ESP32 가 빌드는 되는데 flashing이 다음과 같은 에러메시지로 안되는 경우
Traceback (most recent call last):
File “esptool.py”, line 57, in <module>
File “/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 389, in load_module
File “serial/tools/list_ports.py”, line 29, in <module>
File “/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 389, in load_module
File “serial/tools/list_ports_posix.py”, line 31, in <module>
File “/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 389, in load_module
File “serial/tools/list_ports_osx.py”, line 32, in <module>
ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found
Failed to execute script esptool
기존 esptool을 esptool.py로 다음과 같이 변경을 하면 해결이 된다.
copy /Users/XXXXX/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/esptool.py
to /Users/XXXXX/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.pychmod +x esptool.py
그리고 /Users/XXXXX/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/platform.txt 파일을 열어서 다음과 같이 수정한다.
tools.esptool_py.cmd=esptool -> tools.esptool_py.cmd=esptool.py
platform.txt 파일을 수정하고 Arduino를 재시작
마스터, 슬레이브의 이름에서 주는 주종관계 때문에 그동안 별 의식없이 쓰여왔던 이름들이 바뀌었다.
MOSI – COPI
MISO – CIPO
이 2가지만 기억하면 될 것 같다.
미국의 OSHW협회에서 발간한 THE STATE OF OPEN SOURCE HARDWARE 2021. – https://stateofoshw.oshwa.org/