2

I now have a lamp connected to a RPi Zero W and another Raspberry Pi 3 connected to XMOS. The RPi 3 has AVS "Alexa" running on it.

What I want to do is to set up voice control so that the RPi 3 can send instructions to the RPi Zero to trigger the lamp on/off.

I want to know how I can set up a wireless link between the two RPI. Is it better if I do it with "ad-hoc" or "infrastructure mode" because in the end I want to have the RPi 3 control multiple lamps not just 1 lamp. I am new to this so it would be nice if someone has a link to some similar projects or tutorials.

2

If you set them up in ad-hoc, every device will connect to ever other device. This becomes very chatty when you have many devices. If you set them up in infrastructure, you will need a wireless router to provide communication between devices, but each device will only need to communicate with the router. Lots less unneeded network traffic.

IMHO, if you have a wireless router, set them up in infrastructure. At that point you can give each device an ip/name (edit the /etc/hosts file on the alexa pi and add the hostname/ip mappings) and you can refer to each by name.

In terms of how to run commands, if you setup passsword less ssh-keys, you can run command via ssh on the remote devices. (i.e. switch on/switch off). http://www.linuxproblem.org/art_9.html ssh user@kitchenlight "./run_command_turn_light_off" This is probably the simplest method.

If you have a programming bent, you can create a small daemon that runs on each zero that will receive commands from the alexa pi. python would make this fairly easy as network and json are integrated and wouldn't require the same efforts as writing this in something like c++ or c.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.