Windows Core IoT – NodeJS on a Raspberry PI3

January 15, 2018

Running Windows IoT on a RPI3 is just fun.

To get started some of my previous posts here

Anyhow I wanted to run a webserver on the RPI3… I checked around and one of the most obvious is running NodeJS on a RPI3.

The main advantages are that is that NodeJS is cross platform supported and needs a small memory footprint.

Solution :

1 NodeJS-ChaKaCore

Here : //nodejs.org/en/download/


2. Create a folder on your RPI3

Once download create a connection to your RPI3 and create a folder, like NodeJS


3. After this open the Downloaded ZIP step 1.

    And copy the all the files to the C:\NodeJS on your RPI3, except the SDK folder.

image

4. Create a JavaScript to start the Webserver.

Save it as Server.js on the C:\NodeJS folder

image

var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello World\n');
}).listen(1337);

5. Open the RPI3 Firewall Access

netsh advfirewall firewall add rule name="Node.js" dir=in action=allow program="C:\NodeJS\node.exe" enable=yes 

6. Start the WebServer

image

.\node.exe .\Server.js 


6. Test the connection to your new RPI3 WebNerver

Open a local Browser and test the connection to your http://RPI3:1337

Installing NodeJS Add-on Packages / Modules

Packages or Modules are extensions for NodeJS, see here for more details.

After installation check the version like this :

image

.\npm -v

1. Use NMP to download the required Packages or Modules

I tried this using the PowerShell remote connection … but that did not work.

Solution is to install NodeJS on your Local PC and grab the Modules.

Example : upper-case package


image

Error : ‘node’ is not recognized as an internal or external command

image

Wen running into this error run the command below.

Solution  : SET PATH=C:\Nodejs;%PATH%

2. Copy to the RPI3 NodeJS\node_modules directory


image

3. modify the Server.js JavaScript

Example : module upper-case

image

Notice the extra line require(‘upper-case’)

var http = require('http');
var uc = require('upper-case');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write(uc("Hello World!"));
    res.end();
}).listen(1337);

4. Test the result

image

Notice the response is in capital letters !

Enjoy !

Advertisements

Windows Server 2008 – Task Schedule Error 2147746323

December 18, 2017

When you schedule a Task you might run into the Error 2147746323.

The code appears after you schedule an Email Action

image

When you convert this error number to a HEX number it will disclose the root cause.

Use this PowerShell script to convert it to HEX

CLS

$Value = 2147746323

"0x"+ ('{0:x}' -f $Value)

It will look like this :

image

Meaning : The transport failed to connect to the Email server

So you need to investigate where it goes wrong in connecting to the server.

For more codes see here  :

https://msdn.microsoft.com/en-us/library/windows/desktop/aa383604(v=vs.85).aspx

Enjoy!


Windows Server 2016 – Event ID 7000 & 7009

November 8, 2017

More Event ID Errors, it does not seem to stop … ?

Event ID 7000 and 7009 relating to a Service not starting at reboot.

image

The WseMgmtSvc service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.

SOLUTION :

Go to Services and find Windows Server Essentials Management Service

image

Change the startup to Automatic – Delayed Start

image


Windows Server 2016 – Event ID 7023 Error

November 8, 2017

Every reboot you will see this error 3 times popping up … ?

Service Control Manager Event ID 7023

image

Message :

Data Sharing Service
%%3239247874

SOLUTION :

1. Run this command :

– sc config DsSvc type=own

image

2. Next start the service Data Sharing Service and check it runs OK

image

No errors in the Event Log anymore Smile

Enjoy !


Windows Server 2016 – Event ID 8193 / 8194 Error

November 8, 2017

OK while we are on track solving all critical Event log Errors we just might also tackle this one… Winking smile

Like Event ID 8193 / 8194 and 12291 VSS …

SOLUTION :

1. Event ID 8193 – Check Registry Key Security Settings for the NETWORK SERVICE Account.

MESSAGE : VSS error ID 8193 (Volume Shadow Copy Service error: Unexpected error calling routine RegOpenKeyExW…)

Add the NETWORKS SERVICE account to the VSS Service RegKey Diag :

– HKLM\System\CurrentControlSet\Services\VSS\Diag

image

2. Event ID 8194 – Check DCOM Security Settings for the NETWORK SERVICE Account.

MESSAGE : Volume Shadow Copy Service error: Unexpected error querying for the IVssWriterCallback interface.  hr = 0x80070005, Access is denied.

Open the DCOMCNFG check if the NETWORK SERVICE is present if not add the LOCAL ACCESS.

image


Windows Server 2016 – Event ID 3 Filter Manager Error After Backup starts

November 8, 2017

More Event Error to tackle Sad smile 

image

Message is a follows :

Filter Manager failed to attach to volume ‘\Device\HarddiskVolume64’. 

This volume will be unavailable for filtering until a reboot.  The final status was 0xC03A001C.

According to this blogpost the reason is simple :

https://www.mcbsys.com/blog/2012/12/filtermanager-event-id-3-during-backups/

When using the native Backup solution from Windows, and the backup destination is an External Drive.

You can get this error when the Windows Search Service is running ?

SOLUTION :

Stop the Windows Search Service before the backup starts and start again afterwards.

– net stop wsearch

– net start wsearch

image

You can incorporate this is the existing Backup Scheduled Tasks like this :

Add one command BEFORE and 1 command AFTER the backup job.

image

image

Check the errors afterwards again to see that they are gone.

Enjoy !


Windows Server 2016 – Event ID 82 / 13 / 6 Errors Certificate enrollment for Local system failed

November 7, 2017

image

SOLUTION :

If you have a Certificate Authority Server running in your domain.

Check using the CERTUTIL cmdline tool to see if there are errors.

image

Also use the Certificates MMC to review the active Certificates.

image

Best check if the Domain Controllers are added to the “CERTSVC_DCOM_ACCESS” Domain Local Security Group.

image

image

In the worst case if you don’t need the Certificate Authority Service anymore, follow these steps to stop it and clean up.

1. Open the Certification Authority mmc

image

2. Set the CRL Publication interval according to the instructions below, and Publish

image

image

image

3. Many Steps to Follow  …

https://support.microsoft.com/en-gb/help/889250/how-to-decommission-a-windows-enterprise-certification-authority-and-r

More TroubleShoot info see here :

https://blogs.technet.microsoft.com/instan/2009/12/07/troubleshooting-autoenrollment/

Success !