Node "random" (nkrkv/random/random) does not work

Hello,
The node “random” (nkrkv/random/random) does not work under XOD version 0.32.1 and board Arduino Uno R3.
Get always the error message shown in uploaded picture “error message.png”.

Can someone solve this problem or does anyone know a solution?
Thanks in advance for a quick response.

PS: Similar to post "Do not work node “random” (Do not work node "random") from moi-yashik2 dated Nov ’19.

in the example replace analog-input with analog-read

don’t drag it, open with double click

Tthank you cesars, now it works perfectly.

Dear XODers,
i have a problem with the random node too and need help.

Your
Chris

Compiling sketch…

“C:\Users\Chris\xod\packages\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++” -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ “-IC:\Users\Chris\xod\packages\packages\esp8266\hardware\esp8266\2.4.3/tools/sdk/include” “-IC:\Users\Chris\xod\packages\packages\esp8266\hardware\esp8266\2.4.3/tools/sdk/lwip2/include” “-IC:\Users\Chris\xod\packages\packages\esp8266\hardware\esp8266\2.4.3/tools/sdk/libc/xtensa-lx106-elf/include” “-IC:\Users\Chris\AppData\Local\Temp\arduino-sketch-A62E96521E8F9A5189A9E4B861BDBCD1/core” -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10607 -DARDUINO_ESP8266_WEMOS_D1R1 -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=“ESP8266_WEMOS_D1R1"” -DESP8266 “-IC:\Users\Chris\xod\packages\packages\esp8266\hardware\esp8266\2.4.3\cores\esp8266” “-IC:\Users\Chris\xod\packages\packages\esp8266\hardware\esp8266\2.4.3\variants\d1” “C:\Users\Chris\AppData\Local\Temp\arduino-sketch-A62E96521E8F9A5189A9E4B861BDBCD1\sketch\xod_1592505551808_sketch.ino.cpp” -o “C:\Users\Chris\AppData\Local\Temp\arduino-sketch-A62E96521E8F9A5189A9E4B861BDBCD1\sketch\xod_1592505551808_sketch.ino.cpp.o”

C:\Users\Chris\AppData\Local\Temp\xod_temp_sketchbookIQsIAu\xod_1592505551808_sketch\xod_1592505551808_sketch.ino: In function ‘void xod::nkrkv__random__random::evaluate(xod::nkrkv__random__random::Context)’:
C:\Users\Chris\AppData\Local\Temp\xod_temp_sketchbookIQsIAu\xod_1592505551808_sketch\xod_1592505551808_sketch.ino:1357:31: error: invalid conversion from ‘long unsigned int*’ to ‘unsigned int*’ [-fpermissive]
int rnd = rand_r(seedp);
^

In file included from C:\Users\Chris\xod_packages_\packages\esp8266\hardware\esp8266\2.4.3/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h:11:0,
from C:\Users\Chris\xod_packages_\packages\esp8266\hardware\esp8266\2.4.3\cores\esp8266/Arduino.h:27,
from C:\Users\Chris\AppData\Local\Temp\xod_temp_sketchbookIQsIAu\xod_1592505551808_sketch\xod_1592505551808_sketch.ino:18:
C:\Users\Chris\xod_packages_\packages\esp8266\hardware\esp8266\2.4.3/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h:197:12: error: initializing argument 1 of ‘int rand_r(unsigned int*)’ [-fpermissive]
int _EXFUN(rand_r,(unsigned *_seed));
^
C:\Users\Chris\xod_packages
\packages\esp8266\hardware\esp8266\2.4.3/tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h:65:30: note: in definition of macro ‘_EXFUN’
#define _EXFUN(name, proto) name proto
^

Error: exit status 1
Compilation failed.
Compilation failed
Command Process exited with code 1
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

Solved for Wemos Board

chris-cross/random-wemos-d1@1.0.0

Greez
Chris

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.