2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# ESP RainMaker Custom Device
  
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								This example demonstrates how to build a custom device to be used with ESP RainMaker. 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## What to expect in this example?
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  This example sketch uses the on board Boot button and GPIO16 to demonstrate an ESP RainMaker AC dimmer device. 
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								-  After compiling and flashing the example, add your device using the [ESP RainMaker phone apps ](https://rainmaker.espressif.com/docs/quick-links.html#phone-apps ) by scanning the QR code. 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  Toggling the state from the phone app will toggle the dimmer state (GPIO16). 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  Pressing the Boot button will toggle the dimmer state (GPIO16) and the same will reflect on the phone app. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  You can also change the Level from the phone app and see it reflect on the device as a print message. 
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Output
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[    87][I][RMaker.cpp:13] event_handler(): RainMaker Initialised.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[    94][I][WiFiProv.cpp:158] beginProvision(): Already Provisioned
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[    95][I][WiFiProv.cpp:162] beginProvision(): Attempting connect to AP: Viking007_2GEXT
							 
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Received value = false for Dimmer - Power
							 
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Toggle State to true.
							 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[ 22532][I][RMakerDevice.cpp:162] updateAndReportParam(): Device : Dimmer, Param Name : Power, Val : true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Received value = 73 for Dimmer - Level
							 
						 
					
						
							
								
									
										
										
										
											2021-04-22 15:29:27 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2021-05-18 16:01:29 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Resetting the device
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  Press and Hold the Boot button for more than 3 seconds and then release to reset Wi-Fi configuration. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  Press and Hold the Boot button for more than 10 seconds and then release to reset to factory defaults.