{"id":93,"date":"2017-11-15T10:57:53","date_gmt":"2017-11-15T10:57:53","guid":{"rendered":"https:\/\/connectbox.technology\/wp\/?page_id=93"},"modified":"2021-11-10T19:00:09","modified_gmt":"2021-11-10T19:00:09","slug":"support","status":"publish","type":"page","link":"https:\/\/connectbox.technology\/wp\/support\/","title":{"rendered":"Support"},"content":{"rendered":"<h2>Send Feedback to the Developers:<\/h2>\n<p>Send an email to: <a href=\"mailto:&#x68;&#101;&#108;p&#x40;&#x63;&#111;&#110;&#110;&#x65;&#x63;&#x74;&#098;&#111;x&#x2e;&#x74;&#101;&#099;&#104;&#x6e;&#x6f;&#x6c;&#111;&#103;y\">&#x68;&#101;&#108;p&#x40;&#x63;&#111;&#110;&#110;&#x65;&#x63;&#x74;&#098;&#111;x&#x2e;&#x74;&#101;&#099;&#104;&#x6e;&#x6f;&#x6c;&#111;&#103;y<\/a><\/p>\n<h2>Google Groups Forum \/ Mailing List:<\/h2>\n<p><a href=\"https:\/\/groups.google.com\/d\/forum\/connectbox\" title=\"ConnectBox Google Groups Forum\">ConnectBox Google Groups Forum<\/a><\/p>\n<h2>Add an issue to GitHub:<\/h2>\n<p><a href=\"https:\/\/github.com\/ConnectBox\/connectbox-pi\/issues\" title=\"GitHub Project Issues\">ConnectBox Github Project<\/a><\/p>\n<hr \/>\n<hr \/>\n<h1>Frequently Asked Questions (FAQ):<\/h1>\n<h2>How do I reset my ConnectBox back to &#8220;factory condition&#8221;?<\/h2>\n<p>There are a few steps (a few more than we\u2019d like to be honest, but we\u2019re working on the update mechanism).<\/p>\n<ol>\n<li>Download the latest release image from GitHub: https:\/\/github.com\/ConnectBox\/connectbox-pi\/releases\/ Pick the latest version of the <em>Release<\/em> branch and not the <em>Developer<\/em> version.<\/li>\n<li>Download Etcher (http:\/\/etcher.io\/) so you can burn the image to the microSD. We recommend this program even if you have another method for burning, as it actively verifies that the image has been successfully burnt.<\/li>\n<li>Take the microSD card out of the ConnectBox (you\u2019ll need to open the case to do this)<\/li>\n<li>Burn the image to the microSD card using Etcher (Etcher will burn the image file that you downloaded without requiring decompression)<\/li>\n<li>Pop it back in the ConnectBox and start it.<\/li>\n<\/ol>\n<h2>How do I connect to my ConnectBox via SSH?<\/h2>\n<p>By default, your ConnectBox has SSH disabled over the LAN port.  It is relatively simple to turn it on.  Essentially, you need to create a specifically named directory and a file in that directory on your external USB stick.  Have it inserted, then boot the device.  The ConnectBox will automatically see those items and thereby enable SSH support over the LAN.  The folder must be named:<\/p>\n<p><strong>.connectbox<\/strong> (in all lowercase and with the preceeding period)<\/p>\n<p>Inside that folder, you will need to put a file called: <strong>enable-ssh<\/strong> again without the quotes.  The file can contain information or be blank.<\/p>\n<p>Under <em>Windows<\/em>, the Operating System won&#8217;t let you make folders that start with a period so you need to do something a bit different.  Open up a Command Prompt, (hold down the <strong>WINDOWS-R<\/strong> keys and a window will pop open. Type <strong>cmd<\/strong> into it and hit the OK button).  From the terminal window, go to your USB drive by typing in the following:<\/p>\n<p><strong>D:<\/strong> where D: is the drive letter of your external USB stick.<\/p>\n<p>Then type <strong>mkdir .connectbox<\/strong> which will allow you to make that special folder with the period in the front of the name.  Follow this with the command <strong>cd .connectbox<\/strong> to move inside of that folder.  Then make the file with the command <strong>type nul &gt;enable-ssh<\/strong>.  That is all there is to doing that under Windows.<\/p>\n<p>SSH Login Credentials:<\/p>\n<p><em>username:<\/em> <strong>root<\/strong><\/p>\n<p><em>password:<\/em> <strong>connectbox<\/strong><\/p>\n<h2>How do I enable PHP for my ConnectBox web server?<\/h2>\n<p>The ConnectBox software image does not come with PHP installed by default. However, with a few commands, you can enable PHP to work with your files on your external USB stick.  Follow the instructions below:<\/p>\n<ul>\n<li>Using the above described method, connect to your ConnectBox via SSH to get a BASH console and that your ConnectBox has internet access.  Easiest way to do this is to connect an Ethernet cable from your router to the ConnectBox&#8217;s LAN port.  Depending on the model of ConnectBox that you have, you may need to take the case off to get to the LAN port.<\/li>\n<li>The first thing we want to do is update the code repositories for obtaining the PHP libraries.  From the commandline, type in the following: <code>apt update<\/code> and hit Enter on your keyboard.  Multiple lines will scroll by as the operating system updates itself.  Once it returns waiting at the command prompt, you can proceed with the next step.<\/li>\n<li>We now want to install the current PHP libraries.  We do that by typing in the following and hitting Enter: <code>apt install -y php-fpm<\/code>  This will take a few minutes to complete.<\/li>\n<li>Once PHP has been installed to the system, we need to inform the webserver to start to use it.  We&#8217;ll need to update a config file with new information for the system to know how to use PHP.  Type the following at the commandline and press Enter: <code>nano \/etc\/nginx\/sites-available\/connectbox_static-site.conf<\/code>  An editor will show up with the contents of the configuration file. We want to make the following two changes to the file as shown in green:<\/li>\n<\/ul>\n<pre>\nserver {\n    listen 80;\n    server_name $hostname;\n    root \/media\/usb0;\n    index <span style=\"color:green\"><b>index.php<\/b><\/span> index.html index.htm;\n    error_page 404 \/index.html;\n    access_log \/var\/log\/connectbox\/connectbox-access.log;\n    error_log \/var\/log\/connectbox\/connectbox-error.log error;\n    rewrite_log on;\n\nlocation \/chat {\n  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n  proxy_set_header Host $http_host;\n  proxy_redirect off;\n  proxy_pass http:\/\/127.0.0.1:5000\/chat;\n  # Never cache\n  expires -1;\n}\n\nlocation \/admin\/api {\n  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n  proxy_set_header Host $http_host;\n  proxy_redirect off;\n  proxy_pass http:\/\/127.0.0.1:5000\/admin\/api;\n  # Never cache\n  expires -1;\n}\n\nlocation \/__connectbox_assets__ {\n  alias \/var\/www\/connectbox\/connectbox_default;\n  location ~ .json$ {\n    expires -1;\n  }\n}\n\n\n    # Admin interface\n    location \/admin {\n      alias \/var\/www\/connectbox\/connectbox_default;\n      try_files $uri \/admin\/index.html;\n    }\n    <span style=\"color:green\"><b>\n    location ~ .php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock;\n    }\n    <\/b><\/span>\n}\n<\/pre>\n<p>Use <strong>CTRL-X<\/strong> followed by <strong>Y<\/strong> to save the changes to the file and exit the editor.<\/p>\n<ul>\n<li>We&#8217;ll need to create a test file to see if PHP will work correctly. Type the following into the commandline to create a new file on the root folder of the USB drive: <code>nano \/media\/usb0\/hello.php<\/code> and once the editor opens up to a blank page, type in the following:<\/li>\n<\/ul>\n<p><code>&lt;?php<br \/>\n    print(\"Hello World\");<br \/>\n?&gt;<\/code><\/p>\n<p>Again, use  <strong>CTRL-X<\/strong> followed by <strong>Y<\/strong> to save the changes to the file and exit the editor.<\/p>\n<ul>\n<li>\n<p>Final step at the console line is to restart the websever.  The command to do this is: <code>systemctl reload nginx<\/code><\/p>\n<\/li>\n<li>\n<p>Now that PHP is installed, we need to tell the ConnectBox to run using the Static Web Page mode instead of the default Icon-Only method that just serves up file listings.  We do that by logging into the Admin Panel.  Connect up your phone to your ConnectBox and once connected, type <code>http:\/\/connectbox\/admin<\/code> into the address bar of your browser.  Log in using the admin password (defaults to <code>connectbox<\/code>).  Select the <code>Configuration<\/code> menu item, followed by <code>Web Server<\/code>, then <code>Static site configuration<\/code>. Toggle the buttons so that <code>Enabled<\/code> is selected followed by clicking on the <code>Update<\/code> button.  The device will reconfure itself so that it will now serve up webpages instead of just presenting files.<\/p>\n<\/li>\n<li>Test that the changes worked by typing <code>http:\/\/connectbox\/hello.php<\/code> which will display &#8220;Hello World&#8221; on the screen. If your device tries to download the file instead of rendering it, go back and ensure that the Static site configuration is enabled.<\/li>\n<li>You are now all set to use PHP in your web applications.<\/li>\n<\/ul>\n<h2>How do I install WordPress onto my ConnectBox (Advanced)?<\/h2>\n<ul>\n<li>Using the above described method, connect to your ConnectBox via SSH to get a BASH console and that your ConnectBox has internet access.  Easiest way to do this is to connect an Ethernet cable from your router to the ConnectBox&#8217;s LAN port.  Depending on the model of ConnectBox that you have, you may need to take the case off to get to the LAN port. Alternatively, you can use an external USB WiFi module if it is a Realtek adapter or Railink adaptor.  If you have problems with finding an adapter that is recognized contact Help@connectbox.org  Once the adapter is installed, you will need to use \u201carmbian-config\u201d as root to configure it for connection to your router.<br \/>\nTo connect to an access point you will need to modify the \/etc\/network\/interfaces file and add the following lines at the end of the file..<br \/>\nallow-hotplug wlan1<br \/>\niface wlan1 inet dhcp<br \/>\nwpa-ssid \u201c\u201d<br \/>\nwpa-psk \u201c\u201d<\/li>\n<\/ul>\n<p>Once this is completed you should be able to enter at the command line ifup wlan1<br \/>\nThis will raise the interface and attempt to login to your router.  Note that in the above text the quotation marks are needed but the  is the ssid and password without the &lt; &gt;.<br \/>\nyou can test the internet connection by typing the  following into the command line:<br \/>\nping google.com<br \/>\nit should come back with something like:<br \/>\n(den08s05-in-x0e.1e100.net (2607:f8b0:400f:802::200e)) 56 data byes<br \/>\n64 bytes from den 08s05-in-x0e.1e100.net (2607:f8b0:400f:802::200e): icmp_seq=1 ttl=113 time 11.1ms<br \/>\netc.<\/p>\n<p>to exit the ping enter ^C<\/p>\n<p>Once you have internet access:<br \/>\n* Enter in the following commands at the console line:<br \/>\n  * <code>apt-get update<\/code><br \/>\n  * <code>apt install -y mariadb-server<\/code><br \/>\n  * <code>sudo systemctl start mariadb.service<\/code><br \/>\n  * <code>sudo systemctl enable mariadb.service<\/code><br \/>\n  * <code>mysql_secure_installation<\/code><br \/>\n    * <code>Enter current password for root (enter for none):<\/code>  &lt;&lt;===Just hit Enter here<br \/>\n    * <code>Set root password (Y\/n)<\/code>  &lt;&lt;===Add in a password here by replying Y but remember this password<br \/>\n    * <code>Remove anonymous users (Y\/n)<\/code>  &lt;&lt;===Just hit Enter here<br \/>\n    * <code>Disallow root login remotely? (Y\/n)<\/code>  &lt;&lt;===Just hit Enter here<br \/>\n    * <code>Remove test database and access to it (Y\/n)<\/code>  &lt;&lt;===Just hit Enter here<br \/>\n    * <code>Reload privilege tables now? (Y\/n)<\/code>  &lt;&lt;===Just hit Enter here<br \/>\n  * <code>mysql -u root -p<\/code><br \/>\nWhen asked use the password set above<br \/>\n    From within the MySQL command prompt, type in these commands to create a database for WordPress and a user:<br \/>\n    * <code>CREATE DATABASE connectbox DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<\/code><br \/>\n    * <code>GRANT ALL ON connectbox.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password' note that if you change password then it must be changed below as well in wp-config.php<br \/>\n    *<\/code>FLUSH PRIVILEGES;<code>*<\/code>EXIT;<code>&lt;&lt;===Exits you back to the regular console prompt<br \/>\n    *<\/code>apt install -y php php-fpm php-common php-mysql php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip php-cli php-ldap php-imagick<code>*<\/code>nano \/etc\/nginx\/sites-available\/connectbox_static-site.conf<code>Modify this existing line to add in<\/code>index.php` before the other index types<br \/>\nindex index.php index.html index.htm;<\/p>\n<pre><code>You also need to modify the root file system to:\nroot \/var\/www\/html\/wordpress; \n\nAdd this whole section before the end of the last closing } character\n\nlocation ~ .php$ {\n    include snippets\/fastcgi-php.conf;\n    fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock;\n}\n\nlocation = \/favicon.ico { log_not_found off; access_log off; }\nlocation = \/robots.txt { log_not_found off; access_log off; allow all; }\nlocation ~* .(css|gif|ico|jpeg|jpg|js|png)$ {\n    expires max;\n    log_not_found off;\n}\n<\/code><\/pre>\n<p>Reload the nginx server with:<br \/>\n  * <code>systemctl reload nginx<\/code><\/p>\n<p>Lastly, we install the latest version of WordPress onto the USB drive.<\/p>\n<ul>\n<li><code>cd \/tmp<\/code><\/li>\n<li><code>curl  -LO https:\/\/wordpress.org\/latest.tar.gz<\/code><\/li>\n<li><code>tar xzf latest.tar.gz -C \/var\/www\/html<\/code><\/li>\n<li><code>sudo chown -R www-data \/var\/www\/html\/wordpress<\/code><\/li>\n<li><code>sudo systemctl start mariadb.service<\/code><\/li>\n<li><code>sudo systemctl enable mariadb.service<\/code><\/li>\n<li><code>cd \/var\/www\/html\/wordpress<\/code><\/li>\n<li><code>cp wp-config-sample.php wp-config.php<\/code><\/li>\n<li>\n<p><code>nano wp-config.php<\/code><\/p>\n<p>Change out the following lines:<br \/>\n\u201c The name of the database for WordPress *\/<br \/>\ndefine(&#8216;DB_NAME&#8217;, &#8216;connectbox&#8217;);<\/p>\n<p>\/\u201d MySQL database username *\/<br \/>\ndefine(&#8216;DB_USER&#8217;, &#8216;wordpressuser&#8217;);<\/p>\n<p>\/\u201d MySQL database password *\/<br \/>\ndefine(&#8216;DB_PASSWORD&#8217;, &#8216;password&#8217;);  &lt;&lt;=== note that if you change password then it must be changed below as well in wp-config.php<br \/>\nAdd in the below line somewhere in the config file:<br \/>\ndefine(&#8216;FS_METHOD&#8217;, &#8216;direct&#8217;);<\/p>\n<p>Write out the file and exit nano<\/p>\n<\/li>\n<li>\n<p><code>systemctl reload nginx<\/code><\/p>\n<ul>\n<li>Now that everything is installed, we need to tell the ConnectBox to run using the Static Web Page mode instead of the default Icon-Only method that just serves up file listings.  We do that by logging into the Admin Panel.  Connect up your phone to your ConnectBox and once connected, type <code>http:\/\/connectbox\/admin<\/code> into the address bar of your browser.  Log in using the admin password (defaults to <code>connectbox<\/code>).  Select the <code>Configuration<\/code> menu item, followed by <code>Web Server<\/code>, then <code>Static site configuration<\/code>. Toggle the buttons so that <code>Enabled<\/code> is selected followed by clicking on the <code>Update<\/code> button.  <\/li>\n<li>The device will reconfure itself so that it will now serve up webpages instead of just presenting files.  Wait around 30 seconds for the device to update itself and get organized.  After that, log back into the regular ConnectBox home page (http:\/\/connectbox) and if all went well, you will see the installer for WordPress.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>With WordPress running you may need to create a micro-USB based swap file to enable ram to not overload.  To do this, you can see what the current swap file situation is:<\/p>\n<ul>\n<li><code>sudo swapon --show<\/code><\/li>\n<\/ul>\n<p>This will show the current swap file.  By default there is a ram based swap file \/dev\/zram1 partition about 119M  To add a second swap file of 1GB do the following<\/p>\n<p>..* <code>sudo swapoff -a<\/code><br \/>\n  * <code>sudo fallocate -l 1G \/swapfile<\/code><br \/>\n  * <code>sudo chmod 600 \/swapfile<\/code><br \/>\n  * <code>sudo mkswap \/swapfile<\/code><br \/>\n  * <code>sudo swapon \/swapfile<\/code><\/p>\n<p>This now creates the swapfile and enables it.  to make the change permanent we need to edit \/etc\/fstab as follows:<\/p>\n<ul>\n<li><code>sudo nano \/etc\/fstab<\/code><\/li>\n<\/ul>\n<p>Paste the following line into the file:<\/p>\n<ul>\n<li><code>\/swapfile swap swap defaults 0 0<\/code><\/li>\n<\/ul>\n<p>Then write the file with ^O then exit with ^X<\/p>\n<p>To verify the change, check the swap situation now with:<\/p>\n<ul>\n<li>\n<p><code>sudo swapon --show<\/code><\/p>\n<p>You should now see something like:<br \/>\nNAME       TYPE        SIZE USED PRIO<br \/>\n\/swapfile  file       1024M   0B   -2<br \/>\n\/dev\/zram1 partition 119.6M 7.3M    5<\/p>\n<\/li>\n<\/ul>\n<p>The &#8216;Swappiness&#8217; of the memory now needs to be adjusted since<br \/>\nwe were using 100% ram before lets lower the value:<\/p>\n<ul>\n<li><code>sudo sysctl vm.swappiness=60<\/code><\/li>\n<\/ul>\n<p>and then to make this persistant let edit the \/etc\/sysctl.conf file:<\/p>\n<ul>\n<li><code>sudo nano \/etc\/sysctl.conf<\/code><\/li>\n<\/ul>\n<p>At the end of the file you will find the line &#8216;vm.swappiness=100&#8217; change this to &#8216;vm.swappiness=60&#8217;<\/p>\n<p>Then write the file with ^O and then exit ^X<\/p>\n<p>you can check the current value of &#8216;Swappiness&#8217; with<\/p>\n<ul>\n<li><code>cat \/proc\/sys\/vm\/swappiness<\/code><\/li>\n<\/ul>\n<p>and the output should be 60<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Send Feedback to the Developers: Send an email to: &#x68;&#101;&#108;p&#x40;&#x63;&#111;&#110;&#110;&#x65;&#x63;&#x74;&#098;&#111;x&#x2e;&#x74;&#101;&#099;&#104;&#x6e;&#x6f;&#x6c;&#111;&#103;y Google Groups Forum \/ Mailing List: ConnectBox Google Groups Forum Add an issue to GitHub: ConnectBox Github Project Frequently Asked Questions (FAQ): How do I reset my ConnectBox back to &#8220;factory condition&#8221;? There are a few steps (a few more than we\u2019d like to be [&hellip;] <a href=\"https:\/\/connectbox.technology\/wp\/support\/\" class=\"more-link\">Read more<i class=\"icon-arrow-line-right\"><\/i><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":25,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-93","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/pages\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":20,"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/pages\/93\/revisions"}],"predecessor-version":[{"id":343,"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/pages\/93\/revisions\/343"}],"wp:attachment":[{"href":"https:\/\/connectbox.technology\/wp\/wp-json\/wp\/v2\/media?parent=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}