feedernet / petnet-feeder-service

The Petnet v2 feeder has been hacked!
MIT License
88 stars 20 forks source link

docker-compose up -d petnet-feeder-service #70

Closed bob5731 closed 2 years ago

bob5731 commented 2 years ago

The Compose file is invalid because: Service nginx has neither an image nor a build context specified. At least one must be provided.

mbillow commented 2 years ago

Did you read the comments in the compose file and choose an appropriate line to un-comment?

Because we support older ARM architectures (like the Pi Zero W) you have to choose an nginx image based on what device you are running FeederNet on. 🙂

bob5731 commented 2 years ago

So how do I get nginx image Pi 3b+?

mbillow commented 2 years ago

Just uncomment this line: https://github.com/feedernet/petnet-feeder-service/blob/f1009b04a82fee2579b4e639b0f6f47904f2d24f/sample/docker-compose.yaml#L43

bob5731 commented 2 years ago

so delete the #?

bob5731 commented 2 years ago

Can add fix to the Wiki?

bob5731 commented 2 years ago

sudo docker-compose up -d Pulling nginx (nginx:latest)... latest: Pulling from library/nginx b6e5ca4da968: Pull complete 2c34d682b95d: Pull complete 020f9e72113f: Pull complete 9adeb73e82df: Pull complete b46304c62a09: Pull complete 9f6d60dc775c: Pull complete Digest: sha256:097c3a0913d7e3a5b01b6c685a60c03632fc7a2b50bc8e35bcaa3691d788226e Status: Downloaded newer image for nginx:latest petnet-feeder-service is up-to-date Creating nginx ... error

ERROR: for nginx Cannot start service nginx: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/root/petnet-feeder-service/data/nginx.conf" to rootfs at "/etc/nginx/conf.d/default.conf" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for nginx Cannot start service nginx: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/root/petnet-feeder-service/data/nginx.conf" to rootfs at "/etc/nginx/conf.d/default.conf" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ERROR: Encountered errors while bringing up the project.

how do I fix it?

mbillow commented 2 years ago

You shouldn’t be running docker-compose as root with sudo. When you do that, it makes the ${HOME} in the compose file resolve to root’s homedir, not yours. The setup instructions for Docker should include adding your user to the docker group so that you can use Docker without root access.

mbillow commented 2 years ago

Also, all of this is already in the Wiki. The instructions under step 4 include setting the right nginx image and altering the variables to suit your environment.

https://github.com/feedernet/petnet-feeder-service/wiki/Getting-Started#setting-up-your-first-instance

bob5731 commented 2 years ago

do you have any info on get v1 one work yet.

bob5731 commented 2 years ago

I can get not config work all. So do The Android app to the my feeder config.

mbillow commented 2 years ago

The V1 feeders are based on a completely different IoT platform that actually enforces valid, trusted SSL certificates. It is fair to say that this project will likely never support them.

mbillow commented 2 years ago

You haven’t given any error messages or details to what is or isn’t working. Please make sure you are reading each step in the Wiki carefully. It was written as I setup a new device from scratch so it handles each step in detail without assumptions.

bob5731 commented 2 years ago

The Android app keeps giving me a error_wifi_found and error_wifi_conn and status_wif_found. how do I fix it? read each step in the Wiki and have do each step in the Wiki. I jest got a new v 2 feeder

pi@raspberrypi:~/petnet-feeder-service $ systemctl status dnsmasq ● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2021-11-21 06:56:06 GMT; 16h ago Process: 4372 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS) Process: 4373 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS) Process: 4383 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS) Main PID: 4382 (dnsmasq) Tasks: 1 (limit: 1935) CGroup: /system.slice/dnsmasq.service └─4382 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,20326,8,2,e06d44b80b8f1d39a95c0b0d7c6

Nov 21 06:56:06 raspberrypi dnsmasq[4382]: started, version 2.80 cachesize 150 Nov 21 06:56:06 raspberrypi dnsmasq[4382]: DNS service limited to local subnets Nov 21 06:56:06 raspberrypi dnsmasq[4382]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile Nov 21 06:56:06 raspberrypi dnsmasq[4382]: reading /run/dnsmasq/resolv.conf Nov 21 06:56:06 raspberrypi dnsmasq[4382]: using nameserver 192.168.50.78#53 Nov 21 06:56:06 raspberrypi dnsmasq[4382]: using nameserver 192.168.50.1#53 Nov 21 06:56:06 raspberrypi dnsmasq[4382]: read /etc/hosts - 4 addresses Nov 21 06:56:06 raspberrypi dnsmasq[4382]: read /etc/dnsmasq.hosts - 2 addresses Nov 21 06:56:06 raspberrypi dnsmasq[4383]: Too few arguments. Nov 21 06:56:06 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

bob5731 commented 2 years ago

The Android app keeps giving me a error_wifi_found and error_wifi_conn and status_wif_found. how do I fix it? read each step in the Wiki and have do each step in the Wiki. I jest got a new v 2 feeder

mbillow commented 2 years ago

If I remember correctly from writing the iOS app, the feeder does spit out a few errors when switching to a new WiFi network. This might be expected.

Have you checked to see if the feeder is connected to your network? Most home routers will list connected devices in their GUIs.

bob5731 commented 2 years ago

Yes it did not connect to my home routers. The light is red.

mbillow commented 2 years ago

The light won’t change colors until the feeder connects to FeederNet, it will be red if it is connected to WiFi or not. You checked your router’s GUI and don’t see the feeder?

bob5731 commented 2 years ago

what weould be the name of the feeder the. Yes I did not see the feeder.

npm start

./src/styles/index.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/styles/index.scss) Node Sass does not yet support your current environment: Linux Unsupported architecture (arm) with Unsupported runtime (93) For more information on which environments are supported please see: https://github.com/sass/node-sass/releases/tag/v4.14.

mbillow commented 2 years ago

I’m not sure I get what you are trying to do? Earlier in the thread you asked how to start the Docker image and now you are trying to run npm. The container image has a fully compiled version of the front end included, you don’t need npm to run it.

Regardless, I’m not sure an issue on a specific project is the right place to troubleshoot issues with languages or package managers. There is likely bountiful information about how to resolve this specific problem out on the internet.

bob5731 commented 2 years ago

I'm trying to run you petnet-feeder-service using your setups. I'm trying to connect to the feeder and have it spit out food be of my phone.

petnet

mbillow commented 2 years ago

If you are going to be running it on a RPi, which you are based on the ARM architecture mentioned in the error, my suggestion is to use the Docker image.

bob5731 commented 2 years ago

Ok then I will use the Docker image. But how do I get connect to my network so I can use it.

mbillow commented 2 years ago

Have you done the DNS redirection/hijacking and tested it?

bob5731 commented 2 years ago

I do make a hosts file Create a hosts file for dnsmasq in /etc/dnsmasq.hosts: {IP of Device} api.arrowconnect.io {IP of Device} mqtt-a01.arrowconnect.io

systemctl status dnsmasq ● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2021-11-28 18:08:14 GMT; 1h 57min ago Process: 503 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS) Process: 511 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS) Process: 544 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS) Main PID: 543 (dnsmasq) Tasks: 1 (limit: 1935) CGroup: /system.slice/dnsmasq.service └─543 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anc

Nov 28 18:08:14 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server. Nov 28 18:08:22 raspberrypi dnsmasq[543]: reading /run/dnsmasq/resolv.conf Nov 28 18:08:22 raspberrypi dnsmasq[543]: using nameserver 192.168.50.1#53 Nov 28 18:08:22 raspberrypi dnsmasq[543]: using nameserver 8.8.8.8#53 Nov 28 18:08:22 raspberrypi dnsmasq[543]: using nameserver fd51:42f8:caae:d92e::1#53 Nov 28 18:08:23 raspberrypi dnsmasq[543]: reading /run/dnsmasq/resolv.conf Nov 28 18:08:23 raspberrypi dnsmasq[543]: using nameserver 192.168.50.1#53 Nov 28 18:08:23 raspberrypi dnsmasq[543]: using nameserver 8.8.8.8#53 Nov 28 18:08:23 raspberrypi dnsmasq[543]: using nameserver fd51:42f8:caae:d92e::1#53 Nov 28 18:08:23 raspberrypi dnsmasq[543]: using nameserver 192.168.50.78#53

mbillow commented 2 years ago

Have you set your router to hand out your dnsmasq server’s IP as the DNS server for the network?

bob5731 commented 2 years ago

Yes I did. By using WAN - Virtual Server / Port Forwarding. Would it be called qca-ioeboard. If so the yes . But it will not stay connected

petnet r

mbillow commented 2 years ago

Yes, qca-ioeboard is the feeder. It is disconnecting and reconnecting because it can’t reach FeederNet. You don’t need to do port forwarding to get this to work, you need to adjust your DHCP settings to hand out the IP address of the device running dnsmasq as the DNS server.

Note: You likely want to do this on a separate network (or VLAN), if possible, unless you can guarantee uptime on your DNS server.

bob5731 commented 2 years ago

would rip be ip for the /etc/dnsmasq.hosts?

mbillow commented 2 years ago

Yup

bob5731 commented 2 years ago

Thank You I will let you know If I get working. I'm at het New Feeder Wizard.

What does their food weigh? To make sure we are dispensing the right amount of food, we need to know how dense it is.

We are going to automatically dispense three 1 tbsp portions to get the weight of their food.

Please keep your pet(s) away during this process.

Now jest wait for to do something.

jest got it work. Thank you for the help.