You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by "p3tr0v (via GitHub)" <gi...@apache.org> on 2023/08/30 03:32:44 UTC

[I] [Bug]: Module not imported after following the guide

p3tr0v opened a new issue, #1089:
URL: https://github.com/apache/plc4x/issues/1089

   ### What happened?
   
   Even following the Starting guide, the module is no imported to project.
   
   **Steps to reproduce in your go workspace:**
   $ mkdir plcproject
   $ go mod init
   $ go mod tidy
   $ go work use . 
   _create main.go file with your IDE_
   $ go get github.com/apache/plc4x/plc4go
   _I can see ~/go/pkg/mod/github.com/apache/plc4/plc4go@v0.10.0_
   Then after following the guide with 
   `driverManager := plc4go.NewPlcDriverManager()`
   It just cant find/import the module
   
   **go.mod**
   ```
   module plcproject
   
   go 1.20
   
   require github.com/apache/plc4x/plc4go v0.0.0-20230829070645-b2f3acb97b3b // indirect
   ```
   In the project I can import any module from my _go/pkg/mod/github.com_ directory, but plc4go cant be imported, why?
   
   ### Version
   
   v0.10.0
   
   ### Programming Languages
   
   - [ ] plc4j
   - [X] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [ ] OPC-UA
   - [ ] S7


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699096326

   (also I might update the documentation if I find some time or create a PR if you want integrating the steps I posted above)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699259954

   try `apt-get install libpcap` if you are on a ubuntu system. Guess we need to update the documentation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699249855

   > 
   
   ![result](https://github.com/apache/plc4x/assets/28512249/4443bbd8-5e58-44d7-89c1-3814925a8897)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699251182

   sorry, im not familiar with github, always when i post something, it close the issue, eopening again


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v closed issue #1089: [Bug]: Module not imported after following the guide
URL: https://github.com/apache/plc4x/issues/1089


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699059925

   > what does your import statement look like in the `main.go`? Can you post the code of that file?
   
   thanks for your time!
   The main is simple, when trying to code, VScode just dont find the module.
   ![vs](https://github.com/apache/plc4x/assets/28512249/031be13e-2a7a-47bd-bbbe-18627432335c)
   If I try to force the import, I got this
   ![vs2](https://github.com/apache/plc4x/assets/28512249/67c18361-4c48-4db0-a598-3d82e4eb4f55)
   
    My `go env`
   ```
   GO111MODULE="on"
   GOARCH="amd64"
   GOBIN="/opt/golang/current/bin"
   GOCACHE="/opt/golang/current/gocache/go-build"
   GOENV="/home/user/.config/go/env"
   GOEXE=""
   GOEXPERIMENT=""
   GOFLAGS=""
   GOHOSTARCH="amd64"
   GOHOSTOS="linux"
   GOINSECURE=""
   GOMODCACHE="/home/user/dev/projects/golang-workspace/pkg/mod"
   GONOPROXY=""
   GONOSUMDB=""
   GOOS="linux"
   GOPATH="/home/user/dev/projects/golang-workspace"
   GOPRIVATE=""
   GOPROXY="https://proxy.golang.org,direct"
   GOROOT="/opt/golang/current"
   GOSUMDB="sum.golang.org"
   GOTMPDIR=""
   GOTOOLDIR="/opt/golang/current/pkg/tool/linux_amd64"
   GOVCS=""
   GOVERSION="go1.20.5"
   GCCGO="gccgo"
   GOAMD64="v1"
   AR="ar"
   CC="gcc"
   CXX="g++"
   CGO_ENABLED="1"
   GOMOD="/dev/null"
   GOWORK=""
   CGO_CFLAGS="-O2 -g"
   CGO_CPPFLAGS=""
   CGO_CXXFLAGS="-O2 -g"
   CGO_FFLAGS="-O2 -g"
   CGO_LDFLAGS="-O2 -g"
   PKG_CONFIG="pkg-config"
   GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2976824462=/tmp/go-build -gno-record-gcc-switches"
   ```
   
   
   
   
   whatever other project I can import from ~/go/pkg/mod/github.com, so the problem isn't the IDE.
   
   Why should I delete go.work? Even without this file, the issue persists.
   
   
   
   > and what starting guide are you referring to?
   
   https://plc4x.apache.org/users/getting-started/plc4go.html
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v closed issue #1089: [Bug]: Module not imported after following the guide
URL: https://github.com/apache/plc4x/issues/1089


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1698536443

   and what starting guide are you referring to?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699257172

   yes, but as you can see it works for you. The pcap error is because you need pcap on your system


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1698535753

   delete the `go.work` and use this main.go:
   ```golang
   package main
   
   import plc4go "github.com/apache/plc4x/plc4go/pkg/api"
   
   func main() {
     driverManager := plc4go.NewPlcDriverManager()
     println(driverManager)
   }
   ```
   It should output this when run with that `go run main.go`:
   ```
   $ go run main.go
   {"level":"trace","time":"2023-08-30T07:51:07+02:00","message":"Creating plc driver manager"}
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699093520

   I could not get it working with the `go.work` at I don't know what it does. So if I follow your steps without the `go work use .` (which doesn't work if you strictly follow your steps).
   Do the following:
   
   1. go to tmp `cd /tmp`
   2. make your folder `mkdir plcproject`
   3. go into your folder `cd plcproject`
   4. init the module `go mod init plcproject`
   5. do a tidy `go mod tidy`
   6. get plc4go `go get github.com/apache/plc4x/plc4go`
   7. paste the `main.go` I posted above https://github.com/apache/plc4x/issues/1089#issuecomment-1698535753: `vi main.go`
   8. do a tidy `go mod tidy`
   9. run the main `go run main.go`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1698526983

   what does your import statement look like in the `main.go`? Can you post the code of that file?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699061060

   reopening


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v closed issue #1089: [Bug]: Module not imported after following the guide
URL: https://github.com/apache/plc4x/issues/1089


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699276672

   > apt-get install libpcap
   
   Got success after installing.
   
   But I have to understand why without go.work, from my golang workspace projects, my IDE still saying it:
   
   ![vs](https://github.com/apache/plc4x/assets/28512249/a943d7f8-a17a-4b09-89a3-e2f6f17b66f8)
   
   Doesnt make sense to me.....


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699278831

   no sorry can't help you with that :(


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: Module not imported after following the guide

Posted by "p3tr0v (via GitHub)" <gi...@apache.org>.
p3tr0v commented on issue #1089:
URL: https://github.com/apache/plc4x/issues/1089#issuecomment-1699279876

   thank you for your time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org