Conditional compilation for debugging
IP address upload to log
Moved last_code_log as first code to run.