uraimo / DS18B20.swift

A Swift library for the DS18B20 digital temperature sensor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pi 4 error

gregorFeigel opened this issue · comments

Hi,
I tired your library to read two DS18b20 sensors with a Pi 4.
When running the program it throws:
Fatal error: Unexpectedly found nil while unwrapping an Optional value: /.../main.swift
Current stack trace:
Illegal instruction

I made sure that 1wire is enabled. I can read the values using cat in terminal.
It fails here: let onewires = SwiftyGPIO.hardware1Wires(for:.RaspberryPi4)!
When I set it to .RaspberryPi3 it lists the 1wire id but fails as well.
["28-00000cb48019\n", "28-00000cb40e9c\n"]
Couldn't open 1-Wire device: /sys/bus/w1/devices/28-00000cb40e9c
/w1_slave: No such file or directory
Aborted

Anny Ideas?

Cheers