Grayda / dell-control

Controls a Dell Projector with node.js!
2 stars 1 forks source link

Button pressed on April 12 2019 at 04:34PM #4

Open varVanse opened 5 years ago

varVanse commented 5 years ago

var DelLProjector = require("./dellproj"); // Require our helper library var dell = new DelLProjector(); // Create a new instance of it dell.setIPAddress("10.13.0.29"); // Replace this with the IP address of your projector dell.connect(); // Connect dell.on('connected', function(ipaddress, port) { // If we're connected, send a command! console.log("Connected to " + ipaddress + " on port " + port + ". Sending command .."); dell.sendCommand(dell.commands.power.on); }); dell.on('connecting', function(ipaddress, port) { // If we're connecting still, let us know. console.log("Connecting to " + ipaddress + " on port " + port); });

Grayda commented 5 years ago

I don't quite understand what you're asking here. Can you provide more details about what you're trying to achieve and what's not working for you?

I've closed the three other issues because they're just duplicates of this one.

varVanse commented 5 years ago

Wow, I'm sorry. I'm fairly new to programming and Git. I don't know what I did there

varVanse commented 5 years ago

Maybe you could help me out though. What protocol is this using and what ends up being sent? I'm trying to control my projector with smartthings. Anything I send to that port, the projector gives me a 403 and i have to power cycle

Grayda commented 5 years ago

All good :)

This is using TCP on port 41794, and it's just sending a bunch of bytes which is made up of a "magic word" which tells the projector it's a command, followed by a command. These are the same commands that are sent when you control the projector via a web-browser (i.e. using the Crestron UI)

So to turn the projector on, you'd do this:

If the example provided doesn't work for your projector, it could mean either:

I hope this helps you out, and good luck learning programming. It's tricky, but it is SO much fun when you build awesome stuff that works.

varVanse commented 5 years ago

Wow what a beautifully written and prompt response. I kind of regret telling you this, but I kind of just figured it out... I'm sure that will end up helping someone as stubborn as me (who's spent over a month trying to figure this out on my own). I'd not had much luck with WireShark, maybe faulty configuration when I first installed. I just tried using Microsoft Message Analyzer and sure enough, I'd been sending the hex in the wrong format.

Coding is amazing, it's like a drug. JUST ONE MORE LINE! I wish I'd discovered it sooner in life. I got really into day trading a little over a year ago, which lead to coding my own algo. Automation has kind have taken over my life since then.

Again, thank you so much! So far I've only sent a command through a TCP terminal app on my phone, so I may not be out of the woods yet for the smartthings integration. I'm sure I'll have to come back and give that a second read.