Closed mnishiguchi closed 3 years ago
@mnishiguchi thanks! Can you give me more details about the setup that caused this? MacOS is working for me locally when compiling for host because it detects that its host and puts some mock behavior in.
However, in your setup it is trying to compile for rpi without the cross compile tools. What is you MIX_TARGET
set to?
@jjcarstens Maybe it was because I ran mix test
, which is a habit I have. Looks like mix compile
works with no issue on the Mac host.
The above error happens whenever I run mix test
.
My OS and target:
❯ echo $MIX_TARGET
rpi0
@jjcarstens I looked at main.c
. I do not know details but I see rpi0
unsupported. Despite that, thankfully I was at least able to read the sensor data from DHT11.
So rpi0 is supported. The rpi support is sort of lumped into 2 different "hardware" version. RPI, which is rpi and rpi0 in a nerves context, and RPI2, which is rpi2 and above (rpi3, rpi3a, rpi4)
This is left over from the arduino C code. I don't love it, but haven't spent the time to change it yet either.
You can also see this in the Makefile definitions as well
Going to close this for now. I can reproduce with MIX_TARGET=rpi0 mix test
which is expected because it attempts to compile RPI src for the DHT and then run it on host. I think the simplest fix here is to ensure you run tests under HOST and not the target.
Maybe this is a known issue, but I'll report it just in case anybody has the same issue.
As I quickly googled, Mac does not have the
sched_setscheduler
function, which is called in src/common_dht_read.c.As a workaround, I only compiled the library for my target device:
Here is the error I got on my Mac: