Raspberry Pi Zero + SG90 + Blynk (Air Conditioner "Remote")

Hi All,

Very new to the IoT and Blynk.

Here’s my project. I want to be able to control a servo using a Pi Zero from the Blynk app. After pushing a button in Blynk, it will send the servo to a position and then return to 0. (The servo will have an arm attached to it and will push a button on my Air Conditioner to turn it on or off - sounds silly, I know.)

I’ve installed a fresh version of buster-lite and followed the steps listed HERE with the exception of the repositories step as I’m using ARMv6 hardware and so I followed this link HERE. All was going well until I ran sudo npm install onoff -g and I’m getting the attached. It’s still going…

gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/onoff/node_modules/epoll/.node-gyp/8.11.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/onoff/node_modules/epoll/.node-gyp"

I’m using Blynk as I saw a project somewhat similar but it was a door lock remote yet still used the same hardware. That project was ok to follow but they sidestepped a bunch of things and called it assumed knowledge.

I would be forever grateful for some guidance here.

I also have tried without sudo and was provided the below:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/onoff
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules/onoff
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/onoff'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/onoff'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/onoff\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/onoff' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
1 Like

Have you considered using an infrared LED to control your aircon, instead of the servo method?
This is what many people, including myself do. The IR Remote library has built-in commands for many common brands of aircon, but also has the ability to learn new coded by attaching an IR photodiode to a device and capturing the codes used by your existing remote.

Also, the Raspberry Pi is t really the best hardware for a project like this. You’re much better off with a simple NodeMCU device that requires no operating system and is programmed in C++ (which is much more common within the Blynk and many other maker communities).

Here’s a link to the project I use to control my aircon and ceiling fans using IR LEDs. My infrastructure is rather different to what you’d use because I use Blynk in a non-standard way, but the small white box with two LEDs poking out contains a Wemos D1 Mini, which could run the Blynk code you need to achieve this.

Here’s a bit more about hardware choices:


1 Like

Thanks for the reply, Pete. I have a ducted system without IR functionality. I would have got a commercially available system last year if this was the case. I have been working on a solution for this problem for the last 12 Months and have come to this as the best solution as silly as it sounds. A simple button pusher that will be mounted alongside the control box on the wall.

I’ll take a look at the NodeMCU options.

1 Like

Okay. In my experience these systems almost always have the facility to have ‘slave’ controls that can be piggy-backed on to the current controller to allow the aircon to be controlled from multiple locations within the property. If this is the case with your system then there will almost certainly be contacts available within your existing controller that you could use with an MCU and probably a relay to control the system.

Of course, it depends how comfortable you are with this approach, and whether you’re allowed to do it.

Why not post some details of the aircon and its controller and maybe some pictures as well, so that others can share their thoughts?


Hi Pete,

I called a few local A/C guys about this issue and I felt them shudder at the idea. They said any product Samsung offers will have to be installed on the control box which is in the roof with no man-hole access. Thus saying bye-bye to my ceiling.

Background info:

I purchased my first home in December 2017 and it came with a Samsung Reverse Ducted system using a MWR-WE10 wired control panel and a ConnectAir zone control system. Ever since the summer of 2017 I’ve been looking for a product that would, at the very least, allow me to configure a timer to run the system for an hour or two. The wired controller only has a timer for 6 Hours! And I can’t see a way to alter that. My further requests would be a way to control the unit from my phone.

I’ve seen a lot of products on the market for wall split systems that already have a IR remote function. Sadly, I do not.

I found Samsung do offer a ‘WiFi’ add-on but I can’t find any information on it and the local SA Samsung dealers don’t return my calls or emails.

My last hope was the AirTouch system. It sounded perfect! However, it’s not compatible with the ConnectAir zone motors. So they would need replacing and, since I live in a flat roof townhouse, access would be a costly nightmare.

Here’s all the photos.

Samsung MWR-WE10

Okay, so it looks like the MWR-WE10 is the wired controller in this diagram:

And that there’s some sort of serial communication between the roof mounted unit and the “indoor unit(s)” that presumably is the box next to the thing you’ve taken the cover off.
What’s the device reference number for the “indoor unit” that you have?

I’d guess that it would be fairly easy to sniff the serial comms protocol and figure it out, once you get access to the F1 and F2 wires in the diagram, but much better to see if anyone else have done it already.

I’ve tried googling to see if people have hacked the MWR-WE10 already and can’t find anything, but as this is just an add-on to the indoor controller we might get better results searching for that by model number instead.


1 Like

Hi Pete,

I’d wish I could let you know what the ‘Indoor Unit’ is, but it’s all sealed up in the roof and the “electrician” who installed the unit is MIA. That box to the right of the MWR-WE10 is the zone motor controller - turning rooms on/off. I’m happy to leave that out of the scope of the project as we always have the same ones on.

As a side note, it looks like the Zone Control is connected by a RJ11?

Also, I do have a Arduino Mega from an old 3D printer that I’m not using. It just needs an ESP-01. I’ve just bought one on eBay and might be here within the week given the Christmas season.

I used the Pi Zero has it has WiFi built in and I know others have been able to get their similar projects to work.

Hmmm, how about this then…

Not Blynk related, but maybe an option.


Hahaha, that’s brilliant! Exactly what I need, but $55 AUD is a bit steep. I’d still love to make this using the Pi / Arduino.

Hi Pete, thought I’d let you know that I did it! I also created the below Git page to help others looking to do this. A guy did also point me to this project where a guy was able to tap into the controller but it was a little out of my depth.


This 30s delay only runs the Blynk.run every 30s. Does your device not disconnect or did you change the Blynk heartbeat?

If you want to avoid this, a best method below.

#include <Blynktimer.h>                 //add this lib

Blynktimer timer;                            // declare a timer instance 

timer.setInterval(30000, blinkLED) //add this in setup

//create a new void
void blinkLED(){

digitalWrite(LED, LOW);
     timer.setTimeout(100, [](){   //Lambda timer night delay


Your code for an ESP8266 not the RPi that is mentioned earlier. The same code you published on GitHub is available in the sample sketches above. Under “Sketch builder”

Hi there, I’d love to know how far you got with hacking the MWR-WE10N controller. It does my head in how hard these are to program and that it doesn’t have a WiFi/app interface in 2020!
I have a couple of Arduino’s and Pi’s lying around which I can lend to it.
Would love to touch base and see where you got to.


The OP @LordDamocles may give you the link to the hack he had.

Hey Jay. In short, I wasn’t really able to communicate with the MWR-WE10. I simply made a servo push the on/off button. It wasn’t perfect and was often a little hit and miss. I have plans to replace it with a Wemos Relay - when I get the time.

Cheers and thank for the fast reply.
I get the feeling at this stage that the switch not might be my best bet!
Criminal how poorly designed that controller is and the lack of interoperability or app support such a shame