### Use Raspberry Pi JavaScript

These examples do not use B4J and are based on JavaScript.
Getting Started by measuring the Temperature using Raspberry Pi (RPi) as Server .
Purpose
To measure temperature and show results in Webbrowser via RPi setup as Homeserver.
Hardware
Master Brick, Temperature Bricklet
Server Software
Full installation description provided by Tinkerforge:
http://www.tinkerforge.com/en/doc/Embedded/Raspberry_Pi.html
To check if the Master Brick and connected Brickets are working, start "startx" and open the Brick Viewer.
To access the RPi HomeServer remote, usage of duckdns (see http://www.duckdns.org ) is an option
with Home Router Port Forwarding enabled. Set the port and the access control accordingly.
Client Software
JavaScript
JavaScript Installation
• Download JavaScript Bindings from Tinkerforge downloads (e.g. tinkerforge_javascript_bindings_2_0_0.zip).
• Unpack the bindings in a folder of choice (e.g. Tinkerforge\API\JavaScript).
• Create folder Temperature with a subfolder tinkerforge.
• Copy tinkerforge.js (from JavaScript subfolder browser\source) to \Temperature\tinkerforge folder
• Copy ExampleCallback.html from JavaScript subfolder examples\bricket\temperature/ to \Temperature
JavaScript ExampleCallback.html Changes
Set default Input values:
...
:
,
<input value="TEMPERATUREBRICKLETUID" id="uid" type="text" size="5">
...
Set path to Tinkerforge.js
<script src="./tinkerforge/tinkerforge.js" type='text/javascript'></script>
JavaScript Open in Browser
Open ExampleCallback.html and press Start
The temperature measures will be disolayed in the textarea.
Notes
For security reasons, it is advised to use Authentication (=SECRET)!
Getting Started by Remote Switching Lights
Purpose
To switch a lamp remote ON and OFF.
Uses the Tankerforge Remote Starter Kit.
Hardware
Master Brick, RemoteSwitch Bricklet, Outdoor Switches.
Sofware
Tinkerforge and RPi installation steps as outlined under "Getting Started by measuring the Temperature using Raspberry Pi as Server".
JavaScript Installation
• Download JavaScript Bindings from Tinkerforge downloads (e.g. tinkerforge_javascript_bindings_2_0_2.zip).
• Unpack the bindings in a folder of choice (e.g. Tinkerforge\API\JavaScript).
• Create folder remoteswitch with a subfolder tinkerforge.
• Copy tinkerforge.js (from JavaScript subfolder browser\source) to \remoteswitch\tinkerforge folder
JavaScript ExampleSwitchSocket.html Changes
<html>