Have you ever wanted to upload your own software to Smart plug or Wall switch etc...? because you might have better idea for your own Smart Plug or you would like to customize your own use?
Sintron Smart Device ( developer version) is with OTA included. ( only developer version )
so you don't have to do lots of Hacks, re-wiring, soldering etc... which is also dangerous for you since it's AC 110V ~ 220V. you just need to upload the firmware you got directly. then it's with your brain inside !
--
requirement :
1. Arduino IDE:
2. Make sure the Smart Plug / Wall switch connect to the same wifi as your computer.
3. flash size is less than half of Sintron Device memory.
(ST-027 is with 1M memory, ST-029 with 4M memory)
Step 1. connect them to the same wifi.
when you got the Sintron Smart device, you need to let it know your home/work 's wifi SSID and Password.
you can check the instruction here to set up the wifi ( only need the STEP 1 ):
so that you can make sure they connect to the same wifi.
Step 2: Open Arduino IDE and from the tool -> Port
you will be able to find it :
if you can't find it, please restart the Arduino IDE. make sure they connect to the same wifi and also check firewall settings.
Important notice before you upload:
before you upload it, we would suggest you to test your code first, for example, using nodeMCU etc... and if you plan to upload new code once again. please also include the OTA code in. otherwise you won't be able to upload the code via OTA again !
PS. if you don't include the OTA code. and later you can't upload it again. it is not within the warranty.
This Instruction shows how you can use your own domain to control the Sintron Smart Device.
if you are a developer or if you want to sell Smart Device to your customers. and you don't want them to find the source and real price. or you just want to make your own Smart Home products. this would be a good instruction for you.
note: you can register a new domain for just a few bucks from godaddy.com etc..
( ps. we might change the ip once after one year, you can send us an email, and let us notify you before we change ip, the next time we change ip would be on "1st Feb 2020" )
the benefit of this method is, it's very easy for you to set up. but the downside is, you can only use "http", but can't use "https". if you would like to use https, please check method 2.
Method 2. you can also create your own server. Theory: we are going to run a server by node.js ( Sintron Provides the app ) in computer ( we choose linux in this example, you can also run it in windows etc..) , then point the domain to the server. then it would be ok.
Step 1. you need to have your domain first. ( of course. ) , you can register one from Godaddy.com etc..
Step 2. you need a cloud computer with linux system ( windows is also ok, but linux is more stable), you can register it from amazon aws or google cloud platform (GCP)
aws is free for 1 year, and GCP is free for $300. or you can also use your own linux computer.
please google how to create a VM instance, ubuntu 16.04 above is recommended.
Step 3. after you have a VM instance Ubuntu 16.04 or above.
please SSH connect to your VM instance.
and install necessary tools first.
in command line: do not copy "$", this just shows it's the command. press y & enter if you see any questions.
Step 4: update npm & nodejs to newer & stable version and then reboot:
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable $ sudo npm install pm2 -g
$ sudo reboot
Step 5.
Sintron already created a node js app for you.
let's download it :
$ sudo git clone https://github.com/kingccf/Sintron-domain-transfer.git $ cd Sintron-domain-transfer
$ sudo npm install request
Step 6. now that you already have the app, then you just need to deploy it. then it would be ok.
$ pm2 start domain_transfer.js
ok, now the server is running ! and setup is completed !!
However, in the app, we are using port 8080 to run the server, so we need one more step. yes, we need to open port 8080 from firewall. otherwise firewall would block the connection.
( note: only http, don't use https for now, we will need to install https certificate later, and remember to put 8080, we will also use nginx to forward the port, so later we don't need to specify 8080 too )
the next 2 steps, we are going to make them even better.
Step 8, forward http 80 port to local 8080 port.
for the webpage, we don't need to put :80 in the end, for example: http://google.com:80, because by default browser would think it's port 80.
then you will get the URL with HTTPS too now. it's all done !
if you have any questions, please feel free to post a comment below.
or if you would like to own your own server with your own ip, but still doesn't know how to create the server after this instruction. we can also help you to create it, you can contact us too.
Below is one example to show you how to embed the Sintron Smart Device to your webpage. you can click and see how it reacts. this would require you to have some basic HTML skills, and put the javascript in.
the html and javascript as below:
Sintron Smart Plug / Outlet Website embeded
Click the button to trigger the light from Sintron Smart Plug.
please remember to change the turn on and turn off command to be yours:
function officelighton(){
var url = "https://sintron.vip/?host=google&username=sintron&auth=81aa151057ed4cd1ba76bb6d54483092&led=D13&pin=D14&action=on"
and
function officelightoff(){
var url = "https://sintron.vip/?host=google&username=sintron&auth=81aa151057ed4cd1ba76bb6d54483092&led=D13&pin=D14&action=off"
then copy & paste the code to your website ( in between <body> of html ). then it should work.
note: Sintron Device Has the version without Logo on product itself. so it's good for developer to build and sell to customers.
video for demo here:
Most of Plugs can support Amazon Alexa and Google Home. but almost non of them still can't support iPhone Siri Home Kit yet. ( June 2019 )
Sintron Device : for example ( ST-027 Plug & ST-029 Wall switch ) do have the ability to be embedded this function for iPhone Users.
this is also a good information for you to help your customer or family to build safe Smart Home. only need to use HomeKit app built-in the iOS, and combine all things there. no need to use multiple apps.
easy and quick to control.
if needed, you can also contact us to support you and customize what you need. we hope to work with you to build your customer's smart home too.
--
Requirement:
hardware:
1. Sintron Device ( ST-027 Plug & ST-029 Wall switch Series ) of course.
2. Raspberry Pi board.
knowledge:
1. some basic linux command experience.
--
Theory before we start: Sintron Device doesn't not connect to iOS device directly, so that we need to use a hub ( raspberry pi in this case ) and help us to communicate between Sintron Device and iOS. so first we will install "homebridge" software and also plugin to raspberry pi. then also use the app Sintron provided. then they will combine together.
this article would assume you are familiar with linux/raspberry pi and command line.
if you are not familiar with this, you can also purchase SD card with pre-installed system directly. then you can skip All Steps below.
*connect the ethernet cable or get wifi connected first.
* use SSH to connect to raspberry pi, so that you can copy command & paste directly. How to SSH to server from howtogeek.com.
*log in and Open terminal ( if you are using GUI Desktop.)
*then you will see :
Step 2. install necessary software first.
in command line:
do not copy "$", this just shows it's the command.
choose the example that suits the quantity you have. for example, if you have 2 pcs of Sintron Device, you can download the " 2 device config.json"
then open it with "plain text" editor.
REALLY IMPORTANT: You must use a "plain text" editor to create or modify config.json. Do NOT use apps like TextEdit on Mac or Wordpad on Windows. Apps like these will corrupt the formatting of the file in hard-to-debug ways. free Atom text editor is recommended.
--
the example you downloaded would look like this format.
now we have the config.json customized with your Sintron device.
-
let's put it into system:
$ nano ~/.homebridge/config.json
then paste the config.json you just customized and "ctrl" + "O" to save it.
Step 7. Get homebridge running. ( finally ! )
$ nohup homebridge >homebridge-sintron.out &
running it in background
$ cat homebridge-sintron.out
then you would see QR code again, it's running now !
1) make sure your iOS device connect to the same router as the raspberry pi.
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
then you should be able to see the device show up in your HomeKit app, and you can control it now !
video for how to scan and control here:
-----
FAQ:
1) Home app shows i can't add duplicate device.
it's possible you already scanned before, so there's a record.
try to clear the record and run again: