Ham Radio - Icom PCR1000 FrontEnd

Will do... Was considering renaming it the condomizer.... but....

Easiest thing would be to rename the .knob files to .txt... Lemme see if it works... You can then just compile them to png at your leisure and make any mods u need to them... (Use the KnobManager program on the g200kg site to edit....)

BWidth_50.txt (46.7 KB)

if it works ok, let me know which other ones you want and I will send...

1 Like

Done a bit more on it... thanks to kind help from the pro's on the forum!!

Still very much a work in progress... This step was to get away from waving the cursor around the screen to select up and down scanning... baby steps!!

Been Concentrating on layout/readability/function.... tuning side:

A bit of explanation is needed:

screenshot-127.0.0.1_1880-2021.10.29-00_01_23

A yellow LED below a tuning digit denotes a tuning step of 5, blue LED is a step of 1.... if you press the up or down: screenshot-127.0.0.1_1880-2021.10.29-00_03_22

The knob to the right of the up/down highlights a digit and changes the step size...

But.... I am still not happy.... It's better....but....

Edit: For anybody who wants my hunk o' junk front end:

flows(10).json (168.6 KB)

Almost Done now...

DSP + Controls enabled, a few bugs removed, Att/NB/AGC enabled...

Layout and sizing changed....

Still not happy with manual tuning... Too slow and cumbersome...

Enough for this evening....

2 Likes

Yet another step or 10 forward... Cleaned up code, more glitches sorted, RIT and VSC control added, designed and tidied up a few more knobs and switches....

Here is the command list I have for the receiver, if anybody has any other command list, please share!!

Icom-IC-PCR1000_command_list.pdf (117.3 KB)

And here is the flow for the current layout, the .js file sent earlier for the static directory is the same, unmodded...

flows(12).json (192.4 KB)

Anybody have any idea as to how to upload a .7z file here? (I would like to share the source for the knobs and the Knob designer program too if possible...)

But... as usual, I am still not 100% happy... Tuning is still too cumbersome.... An ideal for me would be a single digit widget for the desktop.... Hover the mouse over it and scroll the mouse wheel up or down.... This would increment the single digit and pass its value to its output at node level... Any help would be immensely appreciated!!

1 Like

A bit more done... A few more controls and facilities done and dusted...

Highlights since last:
Click on the lower graph and it auto-tunes:

Jog dial has a progressive tuning facility... The further you drag it, the faster it tunes:
screenshot-127.0.0.1_1880-2021.11.03-22_55_14

Doesn't seem like much for a weeks worth of plugging in code, but it has made a big difference....

Cheers
Ed

1 Like

After a few or longer frustrating days, I was hoping you would help me to get a tuning knob working. Sorta followed the other thread but got lost and then was off the air for a while. Any chances of a helping hand?

Surely...

Will post the few things I did to get it working, following, it should give you enough to get something going (Very little if anything, was exclusively my own work, I had a LOT of help from the lads here)....

Bear in mind a few things:
a) I'm far from being adept at this level of code...
b) I'm far from adept at most code, parroting is... Well, mostly, the way I get something right..
c) I'm better at welding, machining, gunsmithing, and eating than coding...
d) Don't laugh at my convoluted ways... If there is a better way to do it... Show me (but don't expect me to understand it straight off..)
e) .... The list goes on!!...

Regds
Ed

Ok... Working from memory:

1)Get node Red up and Running

2)Make sure these are installed: Dashboard Nodes(Obviously), contrib multistate switch(if you want the pcr1000 front end), node red node serial(If you want to hook it to your PCR1000)... (Those are the highlights, there might be another node or 2 that you have to palette manager install, but these were the main ones)

3)Create a static directory under .node-red to put your external but still cody type things that Node red needs for the knobs, dials and switches (I used .node-red/node-red-static)

4)Edit your settings.js in your .node-red folder to reflect where the static folder is:
under the section:

    /** When httpAdminRoot is used to move the UI to a different root path, the
     * following property can be used to identify a directory of static content
     * that should be served at http://localhost:1880/.
     */
    //httpStatic: '/home/nol/node-red-static/',
    httpStatic: '/home/username/.node-red/node-red-static/',

Obviously substituting username for your user name as used when you log in...

  1. I then created a further 2 subdirectories in the node-red-static One is:.node-red/node-red-static/js, the other is .node-red/node-red-static/png ... (no prizes for what they will contain eventually :laughing:)

Edit: I suggest you use the same, as the templates for the knobs etc point at these folders specifically, if you use a different name, be prepared to edit them on your own!!

  1. Put the (mentioned above):

into the js directory that you created...

  1. rename it to input-knob.js (You would probably have to restart Node Red at this point.)

  2. Take this png:
    Edit: (Right Click and save link as: TunerKnob1.png )

and put it in your png directory you created... (The png file looks weird onscreen, it is a 101 consecutive frame "filmstrip" of the tuning knob..)

  1. import the following nodes into a flow:
[
    {
        "id": "c701eed40e40f478",
        "type": "ui_template",
        "z": "68e5c71acc43e814",
        "g": "d017b78c09ecbdbe",
        "group": "62350f50d4b09ff8",
        "name": "Knob_Tuner",
        "order": 21,
        "width": 1,
        "height": 3,
        "format": "<div ng-init=\"init()\" class=\"knobwrapper\">\n<input type=\"range\" \nid=\"{{'knob_'+$id}}\" \nng-model=\"knobvalue\" \nclass=\"input-knob\" \ndata-width = \"48\"\ndata-height = \"144\"\nmin=\"-10\" \nmax=\"10\" \nstep=\".1\" \ndata-src = \"/png/TunerKnob1.png\" \ndata-sprites = \"100\"\nng-mousedown=\"send({payload: true})\"\nng-mouseup=\"send({payload: false})\"\n/>\n</div>\n<script>\n(function(scope) {\n   \n    \n    scope.inited = false \n    scope.init = function(){\n        if($(\"#knob_\"+scope.$id).length){\n            actuallyInit()            \n        }\n        else{\n            setTimeout(function(){\n                actuallyInit()\n            },100)\n        }\n    }\n    \n    function actuallyInit(){ \n        console.log(scope.$id,'actuallyInit()')\n        $(\"#knob_\"+scope.$id).closest(\"md-card\").css('padding','unset')\n        if(scope.initialvalue){            \n            scope.knobvalue = scope.initialvalue          \n        }\n        scope.inited = true\n    }\nscope.$watch('msg', function(msg) {\n        if (msg) {        \n            scope.incoming = true\n            scope.knobvalue = msg.payload\n            if(!scope.initialvalue){\n                scope.initialvalue = msg.payload\n            }        \n        }\n  });\nscope.$watch('knobvalue', function(knobvalue) {\n        if(!scope.inited){\n            return\n        }\n        if(scope.incoming){\n            scope.incoming = false\n            return\n        }\n        if (knobvalue) {\n            scope.send({payload:knobvalue})            \n        }\n    })\n       \n   \n})(scope);\n\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 270,
        "y": 1420,
        "wires": [
            [
                "66e589fd4f7bfc62",
                "0d95d7444a3048bc"
            ]
        ]
    },
    {
        "id": "0d95d7444a3048bc",
        "type": "debug",
        "z": "68e5c71acc43e814",
        "g": "d017b78c09ecbdbe",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 675,
        "y": 1420,
        "wires": [],
        "l": false
    },
    {
        "id": "62350f50d4b09ff8",
        "type": "ui_group",
        "name": "PCR1000",
        "tab": "554e77d51ad13f2d",
        "order": 1,
        "disp": false,
        "width": 25,
        "collapse": false,
        "className": ""
    },
    {
        "id": "554e77d51ad13f2d",
        "type": "ui_tab",
        "name": "PCR1000",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Edit: Also add this css script to your flow (it is assigned to "site status" so it applies to your entire site, it wont display on the dashboard, but will point things in the right direction when an additional template is added for another knob... You only need one instance of this css script to use as many instances of the knob template that you place/copy/paste...

[
    {
        "id": "c57d58e3a3d7d9ef",
        "type": "ui_template",
        "z": "68e5c71acc43e814",
        "g": "1501e67dfda50a42",
        "group": "62350f50d4b09ff8",
        "name": "Class=\"input-knob\" Style=\"knobwrapper\"",
        "order": 2,
        "width": 25,
        "height": 1,
        "format": "<script src=\"/js/input-knob.js\"></script>\n<style>.knobwrapper{\n        width:100%;\n        height:100%;\n        display:flex;\n        justify-content: center;\n        align-items: center;\n    }</style> ",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "global",
        "className": "",
        "x": 300,
        "y": 70,
        "wires": [
            []
        ]
    },
    {
        "id": "62350f50d4b09ff8",
        "type": "ui_group",
        "name": "Radio",
        "tab": "554e77d51ad13f2d",
        "order": 1,
        "disp": false,
        "width": "25",
        "collapse": false,
        "className": ""
    },
    {
        "id": "554e77d51ad13f2d",
        "type": "ui_tab",
        "name": "PCR1000",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

10)You should have a vertical twiddly knob fader thing on your dash that spits out numbers when you move it... (It can be dragged up/down/left/right or use the mouse scroll wheel... if you click on it, it sends you a true, when you release the mouse button over it, it sends a false)... If you send it a number from -10 to 10, it repositions the knob onscreen...

11)Once you have this working, I will then send you my infantile effort at grabbing this data from the knob and boosting it into the tuner...

Knob samples and software to create the "png film strips" is available from:
https://www.g200kg.com/en/webknobman/gallery.php

Edit2: The number of frames you create in the filmstrip must be 1 more than what is defined in the knob's palette... (I suspect the knob designer counts from 0, Node-Red from 1...Or vice-versa)

Edit3: I have all of the knobs in both png and .knob format(for modding and re-exporting) for this little project and am willing to share..

Edit4: I have found the Java version of Knobman (from g200kg) works well and while not easy, is quite straightforward once you get the hang of it...

Edit5: Just realised - For this little project, I store all my flow context to disk instead of volatile ram (Allows things to remain set next time you fly it up) - To do so, I edited settings.js and set the following section:

     /** Context Storage
      * The following property can be used to enable context storage. The configuration
      * provided here will enable file-based context that flushes to disk every 30 seconds.
      * Refer to the documentation for further options: https://nodered.org/docs/api/context/
      */
     contextStorage: {
         default: {
             module:"localfilesystem"
         },
     },

Edit: Once you have edited this settings file, don't forget to restart Node-Red...

I hope I haven't forgotten anything... Hope this helps! (If I have forgotten something, don't be shy to mention it, I will edit this post and add it!)

Regds
Ed

So.....
Get a weird line no knob at all. Went to your link to get another png file as that one just feels strange. Picked a random knob and...... it's a .knob file!!! Have no idea what to do with it.

Hi Gerry,

That png file I posted might have been corrupted with rescaling or something when stored on the forum, I don't know... I will try and post the actual.png file itself a bit later today and add it to an edit on that post...

As to the .knob file, that's where the actual Knobman program comes in, from their g200 site, it will "compile" the .knob file into a series of stitched .png files for NR Template to use...

But, on the bright side, it looks like there is some modicum of success, when I screwed up getting the knob to work, I had nothing onscreen at all!

Regds

Ed

Thanks for the help. This weekend I have been told is family time with them coming in from out of town. My computer time will be limited. She does this just to irritate me sometimes I think.

1 Like

Hi Gerry,

Step 8, above, .png updated for you... Tried it out this side and it works...

Regds
Ed

Edit:

I got tired of committee meetings for everything.... Back to being a bachelor after a long absence....

Hi Y'all...

Did some display work, took it all apart, moved things around, made it simpler, made it easier to use as a plain radio, improved tuning dial, added a few more memory channels, improved ...blah...blah...

Split Radio/Scanner/Memory channels into separate groups (To hide what you don't want to see)

As I think I mentioned previously...99% done and only 10 years to go...

Lotsa fun!!

Ed

Edit: Buggrit.... Chopped off the bottom of the scanner section inadvertently...

1 Like

:rofl: love that comment. It’s looking really nice!!

1 Like

So here is a screen shot of what I get. It looks like a slider and not a knob.
weird

It just occurred to me to ask... Are you running on a pi or a laptop?

If I remember correctly, that happens when the template can't find the PNG file.... Will check and come back to you... Are you running Node Red on a pi, Linux or a windoze box?

Edit: Due to missing CSS script... See below...

LoL... Just asked u the same thing in reply to your previous....

I'm on a desktop Fedora 34 box....

Thanks for the compliment Paul,

Wouldn't have been possible without the "eye candy" help from the kind souls on the forum!!

Regds

Ed