Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many improvements #8

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
aa90f43
chore: Remove trailing whitespace
magicus Nov 7, 2023
243e52d
feat: Add additional commands
magicus Nov 7, 2023
8be9836
feat: Add get firmware/alarm commands
magicus Nov 7, 2023
5bdbde0
fix: sendCMDGetDeviceParameters was already implemented
magicus Nov 7, 2023
299ffc8
feat: add one more command and some documentation
magicus Nov 7, 2023
7300e63
refactor: Remove duplication when sending commands
magicus Nov 7, 2023
baaef4a
refactor: Extract knowledge about commands into constants, and simpli…
magicus Nov 7, 2023
fd20d75
refactor: Move documentation to better place
magicus Nov 7, 2023
550009a
Add named constants for PTZ motor control
magicus Nov 8, 2023
d28359d
Add new commands: set_cypush, edit_user, set_alarm, set_datetime and …
magicus Nov 13, 2023
6cc69dd
fix: Only send close if we actually opened the connection
magicus Nov 13, 2023
4b95eda
Fix syntax error
magicus Nov 22, 2023
7c433e0
* Refactor: extract handlePacket()
magicus Nov 22, 2023
398b9e2
Refactor code to improve readability and add new functionality
Bluscream Jan 15, 2024
1785304
Refactor PPPP class and add debug logs
Bluscream Jan 16, 2024
d486eda
[ImgBot] Optimize images
ImgBotApp Jan 16, 2024
cfcd0d7
Refactor PPPP class and add new functionality
Bluscream Jan 16, 2024
6a2a676
Add eval mode option to run.js
Bluscream Jan 16, 2024
57fe274
t
Jan 16, 2024
e44f860
Merge pull request #1 from Bluscream/imgbot
Bluscream Jan 16, 2024
d647afd
- add speaker back as optionalDependency this time
Jan 17, 2024
3ed4cf8
Merge branch 'master' of https://github.com/Bluscream/PPPP
Jan 17, 2024
4e5993e
add increasing reconnectDelay to socket
Jan 17, 2024
af40d0f
fix paths for query parameters and fix /func/ for pw param
Jan 17, 2024
8e5e66d
index template
Bluscream Jan 17, 2024
3a1391e
Merge branch 'master' of https://github.com/Bluscream/PPPP
Bluscream Jan 17, 2024
562dd0f
Refactor URL generation and usage
Bluscream Jan 17, 2024
1e89920
Refactor sendBroadcast method to handle error cases
Bluscream Jan 17, 2024
5422a8f
Refactor makeUrl function and add missing require statement
Bluscream Jan 17, 2024
b941143
a
Jan 17, 2024
ba52802
update
Jan 17, 2024
f72b205
d
Jan 17, 2024
21edcb0
final fixes yay, simple control panel works
Jan 17, 2024
90b0012
mhm
Jan 17, 2024
d654fe7
Update launch.json and pppp.js
Bluscream Jan 17, 2024
fdacc32
add `--video <lq,hq>` argument
Bluscream Jan 17, 2024
1721a30
add sendCMDPtzStop command
Jan 17, 2024
fa9fcff
fix typos
Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run ",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\run.js",
"args": [
"-b", "192.168.2.255",
"-p", "2999",
"-pw", "p4$$wörd",
"-r",
"-e",
"-v", "hq",
"-a"
]
}
]
}
Binary file modified camera.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion crypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ module.exports = {
decrypt,
dh,
eh
}
}
65 changes: 65 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PPPP</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">PPPP NodeJS Client</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse">
<ul class="navbar-nav" id="navbar">
<li class="nav-item">
<!--a class="nav-link active" aria-current="page" href="#">Home</a-->
{{navitems}}
</li>
</ul>
</div>
</div>
</nav>
<div class="container mt-3">
<!--form method="POST" id="ajaxform">
<div class="row" id="buttongrid">
{{-buttons}}
</div>
</form-->
<div class="grid" id="buttongrid">
{{buttons}}
<!--div class="col-6 col-md-4 col-lg-3 mb-3">
<button type="button" class="btn btn-primary w-100">Button 1</button>
</!--div-->
</div>
</div>
<script>
$("#ajaxform").submit(function(e) {
var postData = $(this).serializeArray();
var formURL = $(this).attr("action");
$.ajax({
url: formURL,
type: "POST",
data: postData,
success: function(data) {
}
});
e.preventDefault();
e.unbind();
});
function sendAjaxRequest(url) {
fetch(url)
.then(response => response.json())
.then(data => { console.log(data); })
.catch(error => { console.error('Error:', error);
});
}
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
</body>
</html>
127 changes: 127 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "a9_pppp",
"version": "1.0.0",
"description": "Thanks to all the people in this [Home Assistant Community](https://community.home-assistant.io/t/popular-a9-mini-wi-fi-camera-the-ha-challenge/230108) thread.",
"main": "pppp.js\t",
"main": "run.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -18,6 +18,9 @@
"homepage": "https://github.com/datenstau/A9_PPPP#readme",
"dependencies": {
"commander": "^11.0.0",
"reurl": "^1.0.0-rc.2"
},
"optionalDependencies": {
"speaker": "^0.5.4"
}
}
Loading