Setting up mgcamd 1.26: config and parameters
If you have already installed the emulator on the receiver and are now looking at a blank screen — this article is for you. Here, the mgcamd 1.26 config is fully explained: what files are needed, where they should be located, how to correctly fill in each line, and what to do when there is a connection but the channels still do not open.
I went through all this on Vu+ Duo2 with OpenATV 6.4, so the examples will be specific, not abstract.
What configuration files are needed for mgcamd 1.26
mgcamd does not use a single configuration file. Instead, it reads several files from a fixed directory — and if a file is missing or located incorrectly, the emulator either starts with defaults or does not start properly at all.
File locations: /usr/keys/ and /var/keys/
The standard path on most Enigma2 images —/usr/keys/. But some builds (especially old VTi and some PLi images) read from/var/keys/. This is a classic trap: files are placed in one location, the emulator looks in another.
To avoid guessing, check the startup log. After starting, mgcamd writes something like:
If you want to check at the system level —strace -e trace=open,openat mgcamd 2>&1 | grep keys will show which paths are actually opened. Permissions on the directory:chmod 755 /usr/keys/, on files:chmod 644.
Purpose of mg_cfg, newcamd.list, priority.list, ignore.list
| File | Required | Purpose |
|---|---|---|
| mg_cfg | No (defaults) | Main parameters of the emulator: timeouts, cache, EMM, logging |
| newcamd.list | Yes | List of CWS servers for connection via the newcamd protocol |
| priority.list | No | Priority of polling servers/cards by caid and provid |
| ignore.list | No | Blocking ECM requests for certain caid |
Withoutnewcamd.liststarting the emulator makes no sense — there is simply nowhere to connect. All other files affect speed and stability, but without them mgcamd at least starts.
SoftCam.Key and AutoRoll.Key files
These files are needed not for newcamd connection, but for local decoding of FTA channels with open keys.SoftCam.Keycontains static keys (Biss, Viaccess, and others).AutoRoll.Keyis for automatic updating of Irdeto autoroll. If you have a purely server scheme (newcamd line), these files are optional.
Important point:SoftCam.Keymust be in LF format, not CRLF. If the file was created or edited in Windows using Notepad, mgcamd may read it as empty or with garbage lines. Check withfile SoftCam.Key— it should be "ASCII text", not "ASCII text, with CRLF".
Configuring newcamd.list: connecting to the server
This is the main file for connection. One line — one server. An error in any field — and either LOGIN FAILED, or there is no connection at all.
CWS line syntax: host port user pass key
The line looks like this:
Field breakdown:
- CWS— keyword, mandatory
- hostname.example.com— host or IP of the server
- 15000— port (range 12000–15000, specific — see connection data)
- myuser / mypassword— login and password, provided together with the line
- 01 02 ... 14— 14-byte DES key
A domain is better than an IP address if the server provider has a dynamic address. Writing an IP instead of a domain — and after the first address change on the server side, everything fails. The domain resolves automatically with each reconnection.
14-byte DES key (deskey) and its format
This is not an arbitrary string — it is exactly 14 hex bytes separated by spaces, which is set by the server side. The key must match byte for byte. Two typical problems:
- Copied with an extra space at the beginning or end of the line
- Uppercase letters instead of lowercase (or vice versa — depends on the implementation)
In case of an error in deskey, login may technically pass (TCP connection established), but ECM exchange will be broken — the receiver receives garbage instead of control words. Externally, it looks like "connection exists, but channels do not open".
Always copy deskey from the source in full, avoid manual input.
Multiple servers and order of iteration
Innewcamd.list you can specify several CWS lines:
mgcamd connects to them sequentially, starting with the first line. If the primary server does not respond within the timeout from mg_cfg, the emulator switches to the next one. The default switch timeout is about 5 seconds, but this is hardcoded in mg_cfg.
If the primary line "died," and the backup is not specified — the receiver simply hangs on a black screen and waits. It is better to always have at least one backup line.
Parameters CWS_KEEPALIVE and CWS_INCOMING_PORT
CWS_KEEPALIVE — keepalive ping interval to maintain the connection. If the server drops inactive connections (firewall with idle timeout), reduce the value to 30–60 seconds.
CWS_INCOMING_PORT specifies the local port on which mgcamd listens for incoming newcamd connections — relevant if you use mgcamd as a server for other clients. For regular client use, this parameter is not needed.
Parsing mg_cfg: key parameters
This is where most people get stuck. mg_cfg does not look like a regular config with understandable keys — it uses hex values by positions. Copying someone else's and hoping it will work is a bad strategy.
Config sections and hex value format
The file is divided into sections, each starting with a letter and a colon. Values are hex numbers separated by spaces. Example of a minimal working mg_cfg for version 1.26:
Each position inside curly braces is a separate parameter. There are no labels — only position and value.
M: and C: — timeouts and cache
| Section | Position | Value | Description |
|---|---|---|---|
| M: | 0 | 01 | Debug level (00 — off, 01 — basic, FF — full) |
| M: | 1 | 00 | EMM processing (00 — off, 01 — on) |
| C: | 0 | 0A | ECM timeout in seconds (0A = 10 sec) |
| C: | 1 | 05 | ECM cache size (05 = 5 entries) |
ECM timeout is a critical parameter. Too large (more than 10 seconds) — the receiver waits too long for a response, the screen is black. Too small (less than 3 seconds) — the emulator considers the request unsuccessful before the server has time to respond.
G: (gbox/share) and working with emm
SectionG: manages the gbox protocol and share settings. For a clean newcamd scheme, it is enoughG: { 00 } — to disable everything unnecessary. If EMM is enabled (section M:, position 1 = 01), the emulator will start sending EMM data to the server for card updates. Whether this is needed depends on what your line supports. For most newcamd providers, EMM is not needed and only creates traffic.
Logging: level and output to file
SectionL: manages logging.L: { 01 } — output to syslog.L: { 03 } — output to file/tmp/mgcamd.log. For diagnostics, it is better to set full debug:
After diagnostics, revertM: { 01 00 } — otherwise, the log will grow quickly.
And the main warning: mg_cfg from version 1.38 or from Gbox builds is not compatible with 1.26. The format of positions changed between revisions. Copying someone else's mg_cfg without understanding means getting unpredictable behavior. Use the config specifically for your version and check each parameter.
priority.list, ignore.list, and channel switching acceleration
Many configure these files last or ignore them altogether. This is a mistake if you have multiple CWS lines or one transponder with multiple providers.
Format caid:provid in priority.list
The syntax is simple:
Each line is caid and provid separated by a colon. mgcamd queries the servers in the order they are listed in priority.list. The line higher in the file has a higher priority. If the required caid is third in the list, the receiver will query two "incorrect" ones before reaching the working one — this is real seconds of waiting when switching.
The caid and provid of a specific channel can be viewed in the Service Info plugin on Enigma2 (Info button → PIDs tab) or throughdvbsnoop.
When ignore.list is needed
If you have channels on the transponder with a caid that is not on your line, mgcamd will send ECM requests to all servers and wait for a timeout for each. This slows everything down.ignore.list blocks these requests at the emulator level:
The format is the same as in priority.list, just withI:. Add caids that are definitely not on your line here — and the response speed will noticeably increase.
Reducing ECM response time
Practical scenario: the transponder carries three packages with different caids — 0500, 0604, and 1830. Your line works only with 0500. Without priority.list and ignore.list, the emulator spends time on requests to 0604 and 1830, each of which goes until timeout. With correctly configured files:
- priority.list:
P: 0500:000000— is first - ignore.list:
I: 0604:000000andI: 1830:000000
The channel switching time drops from 4–8 seconds to 1–2. This is not marketing — I measured it on the same receiver before and after.
Diagnostics: why channels do not open
Let's break it down step by step. Not "check everything randomly," but a specific algorithm.
Reading the mgcamd log and CWS status codes
First, enable full debug in mg_cfg (M: { FF 00 },L: { 03 }) and restart the emulator. Look at/tmp/mgcamd.log ortail -f /tmp/mgcamd.log.
What to look for:
CWS connectedorCONNECTED— TCP connection establishedLOGIN OK— login successful, everything is fine up to this pointLOGIN FAILED— incorrect login, password, or deskeycard not found— connection exists, but the required card/provider is not availableECM timeout— the server did not respond in time
The difference between "no connection" and "connection exists, but no dcw" is fundamental. In the first case, the problem is in the network, password, or deskey. In the second — the line is working, but does not contain a card for the required channel or the caid does not match.
Connection check: telnet/nc to the server port
Before digging into the configs, make sure the port is actually accessible:
IfConnection refused or timeout — the problem is at the network level or the server is unavailable. The configs have nothing to do with it. If the connection opens, but LOGIN FAILED — check the login, password, and deskey.
On some Enigma2 imagesnc no — install viaopkg install netcat or usetelnet hostname.example.com 15000.
Error 'card not found' and incorrect caid
This is the most common reason for "connection exists, channels do not open". Login was successful, but DCW (control words) do not arrive.
Verification algorithm:
- Find out the actual caid of the channel through Service Info on the receiver
- Compare with what your line supports (check with your line provider)
- Check priority.list — the required caid may be missing there or in ignore.list
Common mistake: the channel broadcasts in Viaccess (caid 0500), but the line only provides Irdeto (0604). No configuration edits will help — a different line is needed.
Conflict of multiple cams simultaneously
If CCcam and mgcamd are running on the receiver at the same time — they compete for ECM requests and ports. Externally, this may look like random channel openings or endless waiting.
Check running cams:
Keep only one active. If both are needed — separate roles: one as a local client (mgcamd), the other as a server (OScam), and connect mgcamd to the local OScam via 127.0.0.1. But for basic setup, this is unnecessary — disable everything except mgcamd.
One nuance about mgcamd 1.26 config when working with multiple cams: the local portCWS_INCOMING_PORT must not match the port that another emulator is listening on. Port conflict is another source of silent failures.
Where should the configuration files for mgcamd 1.26 be located?
The standard path is/usr/keys/ on most Enigma2 images. Some builds (VTi, some PLi) use/var/keys/. The exact path is checked from the startup log — mgcamd writes where it reads the config from. If the files are not placed there, the emulator simply will not see them and will start with defaults.
Why does mgcamd connect to the server, but channels do not open?
Most likely, the login was successful, but there is no required card or provider on the line. Check the actual caid of the channel through Service Info, compare with what your line supports. Also check priority.list — the required caid should be there, not in ignore.list. This is not a network problem, but a card mismatch.
What does the 14-byte key in newcamd.list mean?
This is the DES key of the newcamd protocol (deskey) — 14 hex bytes separated by spaces. It is set on the server side and must match byte-for-byte with what you have in the CWS line. An error in one byte results in LOGIN FAILED or garbage in ECM exchange. Copy the key in full, do not enter it manually.
How does mg_cfg differ between versions of mgcamd?
The format of hex positions changed between revisions 1.x. The config from 1.38 or Gbox builds is not compatible with 1.26 — parameters may be in different positions or have different meanings. You cannot blindly copy someone else's mg_cfg without checking the version it was written for.
Is it possible to run mgcamd 1.26 together with OScam or CCcam?
Technically yes, but there may be a conflict over ECM requests and ports. It is better not to run two cams in parallel without clear role separation. The working scheme: OScam as a server on a separate port, mgcamd connects to it via 127.0.0.1. For initial setup, leave only mgcamd and sort it out.
What port should be specified in the CWS line?
The port is set by the server side — the specific value is taken from the connection data to your line. A typical range is 12000–15000, but this is not a rule. Port availability is checked vianc -zv hostname port ortelnet hostname port. If the port is unavailable — the problem is not in the config, but in the network or server.
Practical checklist for smooth viewing
Even the best CCCam or OSCam line needs two or three simple preparations. Update your receiver firmware, reset the ECM cache once a week and keep 15–20% free space on the USB stick or internal flash so that the reader can store keys without delays.
When tuning a dish, aim for MER/BER reserve: a two‑degree offset or a loose F‑connector often causes the “freezing” that users blame on cardsharing. Keep a short patch cord to test alternative routers, and save two profiles in OSCam — one for TCP, one for UDP — so you can switch instantly if your ISP starts filtering a protocol.
Utgard.tv monitors each hub 24/7, but you can speed up diagnostics by keeping a short log of your receiver actions. Note the time when you changed the channel, which CAID was active and whether you used Wi‑Fi or Ethernet. This tiny “journal” helps engineers reproduce your environment in the lab and return with a solution in minutes instead of hours.
- Keep two line slots enabled: if the first server hits a maintenance window, the second one instantly takes over without re-entering credentials.
- Run a monthly speed and latency test. Stable 1–2 Mbps with ping <80 ms is enough for SD/HD, but if jitter exceeds 20 ms, switch the router to wired mode.
- Save the Utgard.tv status page and Telegram bot @utgard_tv_bot to bookmarks — they publish maintenance notices before SEMrush or uptime monitors raise alerts.