esp8266 on Primo is a dead end. sooner or later you hit the wall. your only way to changed the program in esp8266 is OTA. if it goes wrong you can never change it without soldering and the AP may be still active.
if you want to try something use only arduino esp8266 package version 2.4 rc1. not newer. 2.4 doesn't work without erasing the flash. and you can't erase the flash without serial connection.