This commit is contained in:
Gregory Salaun 2025-06-07 09:36:56 +02:00
parent ebdf1336a1
commit f1d156ea84
4 changed files with 18 additions and 9 deletions

View File

@ -40,6 +40,7 @@ func NewTCPClient(TCPServer *TCPServer, Countries Countries) *TCPClient {
Address: Cfg.Cluster.Server,
Port: Cfg.Cluster.Port,
Login: Cfg.Cluster.Login,
Password: Cfg.Cluster.Password,
MsgChan: TCPServer.MsgChan,
CmdChan: TCPServer.CmdChan,
SpotChanToFlex: make(chan TelnetSpot, 100),
@ -149,13 +150,14 @@ func (c *TCPClient) ReadLine() {
if strings.Contains(message, Cfg.Cluster.LoginPrompt) {
Log.Debug("Found login prompt...sending callsign")
c.Write([]byte(c.Login + "\r\n"))
c.SetFilters()
if Cfg.Cluster.Command != "" {
c.WriteString(Cfg.Cluster.Command + "\n\r")
}
c.LoggedIn = true
// c.SetFilters()
// if Cfg.Cluster.Command != "" {
// c.WriteString(Cfg.Cluster.Command + "\n\r")
// }
Log.Infof("Connected to cluster %s", Cfg.Cluster.Server)
Log.Info("Start receiving spots")
c.LoggedIn = true
continue
}
}
@ -164,6 +166,11 @@ func (c *TCPClient) ReadLine() {
message, _ = strings.CutSuffix(message, "\n")
message, _ = strings.CutSuffix(message, "\r")
if strings.Contains(message, "password") {
Log.Debug("Found password prompt...sending password")
c.Write([]byte(c.Password + "\r\n"))
}
if err != nil {
Log.Errorf("Error reading message: %s", err)
c.Conn.Close()

View File

@ -27,6 +27,7 @@ type Config struct {
Server string `yaml:"server"`
Port string `yaml:"port"`
Login string `yaml:"login"`
Password string `yaml:"password"`
Skimmer bool `yaml:"skimmer"`
FT8 bool `yaml:"ft8"`
FT4 bool `yaml:"ft4"`

View File

@ -8,13 +8,14 @@ sqlite:
sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\F4BPO.SQLite' # SQLite Db oath of Log4OM
callsign: F4BPO # Log4OM Callsign used to check if you get spotted by someone
cluster:
server: dxc.sm7iun.se # dxc.k0xm.net
port: 23
server: cluster.f4bpo.com # dxc.k0xm.net dxc.sm7iun.se
port: 7300
login: f4bpo
password: 89DGgg
skimmer: true
ft8: false
ft4: false
command: SET/NOFILTER
command:
login_prompt: "login:"
flex:
discovery: true # Radio must be on same LAN than the program

View File

@ -42,7 +42,7 @@ func main() {
cfg := NewConfig(cfgPath)
log := NewLog()
log.Info("Running FlexDXCluster version 0.3")
log.Info("Running FlexDXCluster version 0.4")
log.Infof("Callsign: %s", cfg.SQLite.Callsign)
DeleteDatabase("./flex.sqlite", log)