macOS Big Sur 또는 macOS Catalina 에서 추가 작업이 필요하다.

전체 설치 과정은 [DB]몽고DB 설치 - macOS Big Sur 참조

# 테스트 환경 #
- macOS Big Sur 버전 11.x.x
- mongodb community 버전 4.2.x
- Homebrew 버전 3.x.x

 

오류 원인 : 데이터를 저장하는 폴더를 다음과 같이 만들 경우, 현재 macOS Big Sur에서에서 mongo적용되지 않는다.

$ sudo mkdir -p /data/db
mkdir: /data/db: Read-only file system

위 메시지 무시하고 설치 진행하면 다음과 같은 오류 메시지를 만난다.

오류 메시지 : 

[initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating

 

해결 : dbpath 설정 - 일반적으로 /data/db 경로이지만, /data/db 경로는 macOS Catalina부터 현재 Big Sur 버전에서 적용되지 않으므로, 다음과 같은 다른 경로를 설정한다.

mongod --dbpath /usr/local/var/mongodb/

 

블루투스 스캔 호출 빈도가 짧은 시간 안에 너무 잦으면

ScanCallback() 에 어떤 onScanFailed, onScanResult, onBatchScanResults 도 호출되지 않는다.

로그 > status=6 은 

D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=6 scannerId=-1 mScannerId=0

 

ScanCallback.java

/**
  * Fails to start scan as application tries to scan too frequently.
  * @hide
  */
public static final int SCAN_FAILED_SCANNING_TOO_FREQUENTLY = 6;

 

 

방법 1. 스캔 호출하는 시간 간격을 늘려준다.

방법 2. address 나 uuid 를 알고 있다면 직접 접속으로 스캐닝과 병행하여 구현한다.

 

- 참조 링크

https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library/issues/18#issuecomment-402412139

- 블루투스 도움되는 링크

NordicSemiconductor / Android-BLE-Library https://github.com/NordicSemiconductor/Android-BLE-Library.git

Making Android BLE work — part 1 by Martijn van Welie https://link.medium.com/jOoagTLCY4

+ Recent posts