Hi guys i work on iot project i use arduino uno,esp8266,pir sensor and relay.first i connect esp8266 with arduino and i run basic at commands after that i install mosquitto broker on ubuntu 16.04 lts and the server running very good with default port 1883 and my local ip from my university network(dhcp) i connect to mobile app mymqtt.i have a code for pub sub client for serial communication esp-server-mymqtt and i can pub and sub and i saw the results in serial communication tab.My problem is i have another code for pir&relay and i didnt know how i combine 2 codes in one the large code of pub sub and the code of pir and relay i have stuck i want help


Some suggestions on combing sketches here:

Hi terry i sent you an email with details of my problem