Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    gadget-man
    @gadget-man
    @rojer it doesn’t look as though it’s working. I’m doing a clean build (local), then going into my deps folder and changing modules/mongoose-os/platforms/esp32/sdk.version to docker.io/mgos/esp32-build:4.2-r1-dbg1 then building again. It builds Ok, but when I OTA the update, it still shows esp32_main.c:65 ESP-IDF 4.2-r1 in the boot. I’ll DM you the build.log to see if you can see what’s going wrong.
    Mizer
    @amizer12
    Hi All, I`m using GPIO4 in output mode to drive a simple relay on and off, relay is a NO type of relay but for some reason it always starts as closed right after app boots. When i add GPIO.write(4,0) to force it to open right after application starts it completely ignores it. And when i do GPIO.Read(4) it always shows 0. Is there anything specific i need to do in order to setup this pin properly ( set pull etc ) ?
    This is what im using to setup a relay to be off at start ->GPIO.write(4,0);
    GPIO.set_mode(4, GPIO.MODE_OUTPUT);`
    Mizer
    @amizer12
    If i want it to start as off - should i set the pull to DOWN ?
    DrBomb
    @DrBomb
    Are you able to see the GPIO changing state?
    gadget-man
    @gadget-man

    I've had mos running on a Raspberry Pi for a couple of years using the above, but I've just tried to install on a new build and I'm getting errors as below:

    go version go1.13.4 linux/arm
    GOOS= GOARCH= CC= CXX= \
    /usr/local/go/bin/go build -mod=vendor -tags '' -ldflags '-s -w ''' -o mos github.com/mongoose-os/mos/cli
    # pkg-config --cflags -- libftdi1
    Package libftdi1 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libftdi1.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libftdi1' found
    pkg-config: exit status 1
    Makefile:93: recipe for target 'build-mos' failed
    make: *** [build-mos] Error 2

    Anyone got any suggestions what might be causing this?

    I already have libftdi1 installed via sudo apt-get install libftdi1
    libftdi1 is already the newest version (0.20-4).
    libftdi1 set to manually installed.
    Sergio R. Caprile
    @scaprile
    I'm not a debian user, in my distro there are binary packages and developer packages, the headers are in the developer package. Those developer packages usually update the pkg-config database.
    When manually installing compiled code ldconfigdoes the trick of providing the needed info. I read you manually installed it, try running ldconfig as root.
    Another possibility is to search for the .pc file as suggested and if it is outside of the expected path, you can add its path to PKG_CONFIG_PATH.
    Sergio R. Caprile
    @scaprile
    In RHEL I would install a -devel package, did you try apt-get install libftdi1-dev ?
    DrBomb
    @DrBomb
    Do we have a reference of what we can do on a conds section inside a mos.yml?
    Mark
    @markterrill
    @gadget-man follow the breadcrumbs in the error report. check the value of PKG_CONFIG_PATH, then see where lifftdi1 is actually installed and if it's in the paths of the PKG_CONFIG_PATH
    ie, env | grep PKG_CONFIG_PATH to see what the paths are
    then which lifftdi1 to see where that is installed. compare and contrast the base directory of lifftdi1 to the PKG_CONFIG_PATH
    if it's not in there, add it to the environment variable. export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:[insert path to lifftdi1]"
    can make it permanent by adding it to your bashrc etc
    can you do me a favour and flick me your working dns-sd configuration / code and confirmation whether you see any log messages on bootup matching 'dns' and 'SRV' ?
    Mark
    @markterrill
    interestingly enough, i loaded up a device with an older firmware and it registers with dns-sd ! "mg_id": "20210113-015249/2.19.0-2-g576bfcd2-master-dirty",
    geezus. ok please ignore me. dns-sd is seeing (and updating) with old and new firmwares. last night i rebooted the mac as for some reason it wasn't acquiring a dhcp IP on two of our network SSIDs. I think something network related was borked on the mac.
    literally wasted about 8 hours over 2 days trying to diagnose it.
    Liviu
    @nliviu
    @gadget-man You need to install libftdi1-dev
    sudo apt install libftdi1-dev
    gadget-man
    @gadget-man
    Thanks all I’ll try that. @markterrill do you still want the dns-sd code? Sounds as though you’ve got it sorted...
    gadget-man
    @gadget-man
    OK now I’m getting a different error (having installed libftdi1-dev):
    go version go1.15.7 linux/arm
    GOOS= GOARCH= CC= CXX= \
      /usr/local/go/bin/go build -mod=vendor -tags '' -ldflags '-s -w ''' -o mos github.com/mongoose-os/mos/cli
    # runtime
    /usr/local/go/src/runtime/mgclarge.go:142:26: mheap_.treapalloc undefined (type mheap has no field or method treapalloc)
    /usr/local/go/src/runtime/mgclarge.go:193:8: mheap_.treapalloc undefined (type mheap has no field or method treapalloc)
    /usr/local/go/src/runtime/mgclarge.go:249:9: undefined: scavengeTreapNode
    /usr/local/go/src/runtime/signal_unix.go:525:5: crashing redeclared in this block
        previous declaration at /usr/local/go/src/runtime/signal_sighandler.go:15:5
    /usr/local/go/src/runtime/signal_unix.go:530:5: testSigtrap redeclared in this block
        previous declaration at /usr/local/go/src/runtime/signal_sighandler.go:20:5
    /usr/local/go/src/runtime/signal_unix.go:544:6: sighandler redeclared in this block
        previous declaration at /usr/local/go/src/runtime/signal_sighandler.go:33:69
    /usr/local/go/src/runtime/unaligned2.go:12:6: readUnaligned32 redeclared in this block
        previous declaration at /usr/local/go/src/runtime/alg.go:374:40
    /usr/local/go/src/runtime/unaligned2.go:17:6: readUnaligned64 redeclared in this block
        previous declaration at /usr/local/go/src/runtime/alg.go:382:40
    Makefile:93: recipe for target 'build-mos' failed
    make: *** [build-mos] Error 2
    (I’ve also updated go to 1.15.7)
    Liviu
    @nliviu
    I tried to upgrade in place to go 1.15.13 and got build errors.
    After sudo rm -rf /usr/local/go and installing 1.15.13 it builds ok.
    gadget-man
    @gadget-man
    Thanks @nliviu I’ll try that now.
    Mizer
    @amizer12
    @DrBomb - the thing is that i can hear relay clicking when id do a GRPIO.write (4,1) and it is going On - but the GPIO.Read(4) always read 0 - always, no matter if the gpio is o or 1. relay on or off
    Not sue if that is related to teh fact that this GPIO runs in output mode ( GPIO.Read reads GPIO16 that i have setup as input fine - it reads 0 or 1 properly )
    Liviu
    @nliviu
    @amizer12 You need mgos_gpio_read_out to read the status of a GPIO setup as output.
    gadget-man
    @gadget-man
    I’m nearly there! It works if I call mos/mos, but if I try just mos I get command not found. I’ve already got export MOSPATH=$HOME/mos in my .bashrc, but guess I’m missing somethign still?
    Mizer
    @amizer12
    @nliviu Thanks ! this is missing from js.api as read in js.api for GPIO uses mgos_gpio_read - i`ll expose it withi a sample project and see if it runs fine, if so i will crate a pull request to get this added to the js .api as well
    Liviu
    @nliviu
    @gadget-man Or you can move it in /usr/local/bin which should be in the PATH.
    gadget-man
    @gadget-man
    Ok. Do I move the whole mos directory there?
    Liviu
    @nliviu
    NO, only the executable.
    gadget-man
    @gadget-man
    Ah oK.
    TY
    Liviu
    @nliviu
    NP :)
    DrBomb
    @DrBomb
    @amizer12 If the relay's clicking it should be working. What's the problem then?
    abhibhatia98
    @abhibhatia98

    Hi, I am working around an project with esp8266 and pi loaded ubuntu as host. I have flash the firmware to esp and connected to n/w. The logs shows it first try to connect with n/w and get failed with error code 3 or 202. After 2/3 second again try to connect with n/w and got connected. And shows the ip as well and also on network device, the esp shows up in connected device list. After that I ran mos call Sys.GetInfo it shows :

    `{
    .....parameter....,
    "wifi": {
    "sta_ip": "",
    "ap_ip": "",
    "status": "connecting",
    "ssid": ""
    }
    }' while the network device still shows it as connected
    Any idea what could be the issue ?

    Sergio R. Caprile
    @scaprile
    Did you sniff your network ? Did you check your AP logs for further info ? Perhaps your device reboots when mos connects via serial and that is why you don't see anything in Sys.Getinfo, have you checked that ?
    abhibhatia98
    @abhibhatia98
    @scaprile I have not checked AP logs, but I have checked that esp has n/w connectivity it is able to connect with cloud. The issue is sys.GetInfo doesn't show wifi info correctly
    Sergio R. Caprile
    @scaprile
    That is quite a claim, since it works for every one else except for you.
    You describe two issues:
    1- If your device fails to connect and then connects later, sniff your network and check your AP logs.
    2- If you don't see your IP in Sys.Getinfo, that can be because perhaps your device reboots when mos connects via serial to issue the command.
    If your device is connected to WiFi, has an IP address, and you compiled in a web server, you can get the info by connecting via HTTP or using Websockets (I know it is not very useful since you have to know the IP beforehand... but at least you will see that the RPC returns the correct information); just use the --port flag followed by the URL.
    You can also connect through MQTT
    abhibhatia98
    @abhibhatia98
    @scaprile well I am on work's place n/w so can't access the logs. But I came up with an observation the above mentioned issue cames only when device (esp) is connected to pi, while I connected the same device to my windows laptop and call Sys.GetInfo it gives me correct values.
    chrisbucher
    @chrisbucher
    Hi guys! I am having some problems with rpc_acl, namely that the ch_type is ignored:
    Here is my rpc_acl:
    [
    {"method": "", "ch_type": "WSS_out", "acl":""},
    {"method": "FS.", "acl":""},
    {"method": "", "acl": "-"}
    ]
    This should allow any users request from WSS_out (mdash), but block any other rpc on all channels (except for FS.), right?
    With this rpc_acl, I can call any RPC from any channel, so it is not working.
    If i change the first line to {"method": "
    ", "ch_type": "WSS_out", "acl":"admin,-*"}, i need the admin creds to call any rpc but even using the mos tool over UART.
    Any advice? My goal is to allow all rpc from mdash, but block some, allow others with admin and leave some free for all.
    Deomid Ryabkov
    @rojer
    @chrisbucher i think some symbols in the acl you posted got eaten by markup, can you put it inside
    triple backticks
    chrisbucher
    @chrisbucher
    [
      {"method": "*", "ch_type": "WSS_out", "acl":"*"},
      {"method": "FS.*", "acl":"*"},
      {"method": "*", "acl": "-*"}
    ]