johnwalicki / Node-RED-Tello-Control

Node-RED flows to control the Ryze Tello Drone
Apache License 2.0
127 stars 87 forks source link

Error on using Watson Image Recognition #19

Open bohanchen opened 4 years ago

bohanchen commented 4 years ago

Hello Everyone,

I am learning how to use Node-red to programing a drone. I imported the solution flow, and I got the Camera working, but after I put my API key from the Watson service, it gave me an error: getaddrinfo ENOTFOUND iam.bluemix.net

Following this tutorial, https://www.youtube.com/watch?v=9NoxljNbovM, I wrote a test flow to check if image recognition is working. It showed that the Watson Service is working correctly, and give me the correct result

Could anyone help me to solve this issues? Are there any problems with the solution flow?

Thank you

johnwalicki commented 4 years ago

Hi bohanchen - I've seen odd behavior when importing flows that contain nodes that have potentially changed in the palette. Delete the Watson Visual Recognition node that was imported, drag a Watson Visual Recognition node from the palette. Wire it up the same way. Put in your API key.

johnwalicki commented 4 years ago

@bohanchen Another idea - What version of node-red-node-watson do you have installed? The most recent version is 0.7.8

bohanchen commented 4 years ago

Hello John, Thank you so much for your reply. I tried to rewire the Watson visual recognition node. It is still not working and giving me the same error "getaddrinfo ENOTFOUND iam.bluemix.net". My current node-red-node-Watson version is 0.7.8, which is also the latest. I guess the problem is because when I run the image recognition with the Tello, it needs to connect to the Tello wifi, which can't connect to Watson service?

bohanchen commented 4 years ago

Hi John, I think I know where the problem is. I need to use the internet cable to connect to the Watson Service in order to make it work. I ignore it from the Github page. Yet here is my other following questions: is it possible to make the Watson Service work offline? Sometimes, in the real-world scenario, the response team might not have internet access to Watson or similar could service. Thank you.

johnwalicki commented 4 years ago

Correct - You need two network connections. The WiFi on your laptop should connect to the Tello drone. The hard wired ethernet cable (or a 2nd wifi dongle) would connect to your home broadband network and the Internet. You need an Internet connection to send the images to the Watson Visual Recognition service running in IBM Cloud.

Watson Visual Recognition is a cloud service that does image classification. It is a pre-trained model of over 12000 objects. You can't download that pre-trained model to your laptop.

If you want to run image classification local on your laptop while connected to the Tello drone, there are several options. Check out the MAX Object Detection model - https://developer.ibm.com/exchanges/models/all/max-object-detector/

You can see an implementation of real time object detection in the DroneAID project https://github.com/Code-and-Response/DroneAid We trained a model to look for aid symbols. You download the model and run it local (using tensorflow.js) It then uses ffmpeg to grab frames from the Tello video stream. If the model detects its trained image, the node.js server draws a bounding box.

I created a simple Node-RED example that captures the video stream. https://github.com/johnwalicki/Node-RED-DroneViewer/

bohanchen commented 4 years ago

Thank you so much for your help and these cool projects. These are very helpful.

johnwalicki commented 4 years ago

@bohanchen - You're welcome - Once you connected an ethernet cable were you able to classify drone images using Watson Visual Recognition?

bohanchen commented 4 years ago

@johnwalicki - I tried to use my extra wifi adapter yet it is not compatible with macOS. I will try again once I receive the ethernet cable adapter for my Mac. I will keep you updated. Thank you.